// Grab the type of plugin from the export _PluginType function
352086
func (p plugin) getType() Type {
	var typeFn func() uint16
	fnName := "_Type"
	p.lib.Sym(fnName, &typeFn)
	if typeFn == nil {
		panic("Failed to load plugin: Missing _Type function")
	}
	return Type(typeFn())
}
372573
func (p *TCompactProtocol) getTType(t tCompactType) (TType, error) {
	switch byte(t) & 0x0f {
	case STOP:
		return STOP, nil
	case COMPACT_BOOLEAN_FALSE:
	case COMPACT_BOOLEAN_TRUE:
		return BOOL, nil
	case COMPACT_BYTE:
		return BYTE, nil
	case COMPACT_I16:
		return I16, nil
	case COMPACT_I32:
		return I32, nil
	case COMPACT_I64:
		return I64, nil
	case COMPACT_DOUBLE:
		return DOUBLE, nil
	case COMPACT_BINARY:
		return STRING, nil
	case COMPACT_LIST:
		return LIST, nil
	case COMPACT_SET:
		return SET, nil
	case COMPACT_MAP:
		return MAP, nil
	case COMPACT_STRUCT:
		return STRUCT, nil
	}
	return STOP, TException(fmt.Errorf("don't know what type: %s", t&0x0f))
}
231985
func getContentType(val string) string {
	args := strings.SplitN(val, ";", 2)
	if len(args) > 0 {
		return strings.TrimSpace(args[0])
	}
	return val
}
1208956
func (v *Type) GetMapType() (o *TypePair) {
	if v != nil && v.MapType != nil {
		return v.MapType
	}

	return
}
1256044
func (s *GetService) Type(typ string) *GetService {
	s.typ = typ
	return s
}
1321804
func (c *TsCell) GetDataType() string {
	var dType string
	switch {
	case c.cell.VarcharValue != nil:
		switch c.columnType {
		case riak_ts.TsColumnType_VARCHAR:
			dType = riak_ts.TsColumnType_VARCHAR.String()
		case riak_ts.TsColumnType_BLOB:
			dType = riak_ts.TsColumnType_BLOB.String()
		default:
			dType = riak_ts.TsColumnType_VARCHAR.String()
		}
	case c.cell.Sint64Value != nil:
		dType = riak_ts.TsColumnType_SINT64.String()
	case c.cell.TimestampValue != nil:
		dType = riak_ts.TsColumnType_TIMESTAMP.String()
	case c.cell.BooleanValue != nil:
		dType = riak_ts.TsColumnType_BOOLEAN.String()
	case c.cell.DoubleValue != nil:
		dType = riak_ts.TsColumnType_DOUBLE.String()
	}

	return dType
}
1245611
func (c *Client) GetPlugin(typ, name string, ver int) *GetPluginResult {
	r := &GetPluginResult{}

	path := "/plugins/" + typ + "/" + name + "/" + strconv.Itoa(ver)

	resp, err := c.do("GET", path, ContentTypeJSON)
	if err != nil {
		r.Err = err
		return r
	}

	switch resp.Meta.Type {
	// TODO change this to concrete const type when Joel adds it
	case rbody.PluginReturnedType:
		// Success
		b := resp.Body.(*rbody.PluginReturned)
		r.ReturnedPlugin = ReturnedPlugin{b}
		return r
	case rbody.ErrorType:
		r.Err = resp.Body.(*rbody.Error)
	default:
		r.Err = ErrAPIResponseMetaType
	}
	return r
}
1274792
func (tmpl *Template) GetType() TemplateType {
	if tmpl.Container != nil {
		return TemplateTypeContainer
	}
	if tmpl.Steps != nil {
		return TemplateTypeSteps
	}
	if tmpl.DAG != nil {
		return TemplateTypeDAG
	}
	if tmpl.Script != nil {
		return TemplateTypeScript
	}
	if tmpl.Resource != nil {
		return TemplateTypeResource
	}
	if tmpl.Suspend != nil {
		return TemplateTypeSuspend
	}
	return "Unknown"
}
774082
func (item *MultiGetItem) Type(typ string) *MultiGetItem {
	item.typ = typ
	return item
}
1259633
func (t *PluginInterfaceType) UnmarshalJSON(p []byte) error {
	versionIndex := len(p)
	prefixIndex := 0
	if len(p) < 2 || p[0] != '"' || p[len(p)-1] != '"' {
		return fmt.Errorf("%q is not a plugin interface type", p)
	}
	p = p[1 : len(p)-1]
loop:
	for i, b := range p {
		switch b {
		case '.':
			prefixIndex = i
		case '/':
			versionIndex = i
			break loop
		}
	}
	t.Prefix = string(p[:prefixIndex])
	t.Capability = string(p[prefixIndex+1 : versionIndex])
	if versionIndex < len(p) {
		t.Version = string(p[versionIndex+1:])
	}
	return nil
}
295591
func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest {
	r.typ = typ
	r.source = nil
	return r
}
233170
func (r Metric_Tracking_Object) GetType() (resp datatypes.Metric_Tracking_Object_Type, err error) {
	err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getType", nil, &r.Options, &resp)
	return
}
213925
func getPluginType(t core.PluginType) int32 {
	val := int32(-1)
	switch t {
	case core.CollectorPluginType:
		val = 0
	case core.ProcessorPluginType:
		val = 1
	case core.PublisherPluginType:
		val = 2
	}
	return val
}
189853
func getImports(
	interfaces []reflect.Type,
	pkgPath string) importMap {
	imports := make(importMap)
	for _, it := range interfaces {
		addImportForType(imports, it)
		addImportsForInterfaceMethods(imports, it)
	}

	// Make sure there are imports for other types used by the generated code
	// itself.
	imports["fmt"] = "fmt"
	imports["oglemock"] = "github.com/jacobsa/oglemock"
	imports["runtime"] = "runtime"
	imports["unsafe"] = "unsafe"

	// Remove any self-imports generated above.
	for k, v := range imports {
		if v == pkgPath {
			delete(imports, k)
		}
	}

	return imports
}
437230
func (s *ScriptSort) Type(typ string) *ScriptSort {
	s.typ = typ
	return s
}
1133097
func (m *Module) LookupType(name string) (TypeSpec, error) {
	if t, ok := m.Types[name]; ok {
		return t, nil
	}

	return nil, lookupError{Name: name}
}
63980
func (_class VMPPClass) GetBackupType(sessionID SessionRef, self VMPPRef) (_retval VmppBackupType, _err error) {
	_method := "VMPP.get_backup_type"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMPPRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertEnumVmppBackupTypeToGo(_method + " -> ", _result.Value)
	return
}