Documentation ¶
Index ¶
- func InstallProviderPlugin(pluginName string, newFunc func(string) Provider)
- func RegisterCustomProvider(microserviceName string, p Provider)
- func RegisterSchema(microserviceName string, schema interface{}) (string, error)
- func RegisterSchemaWithName(microserviceName string, schemaID string, schema interface{}) error
- type DefaultProvider
- func (p *DefaultProvider) Exist(schemaID string, operationID string) bool
- func (p *DefaultProvider) GetOperation(schemaID string, operationID string) (Operation, error)
- func (p *DefaultProvider) Invoke(inv *invocation.Invocation) (interface{}, error)
- func (p *DefaultProvider) Register(schema interface{}) (string, error)
- func (p *DefaultProvider) RegisterName(name string, rcvr interface{}) error
- type Operation
- type Provider
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallProviderPlugin ¶
InstallProviderPlugin install provider plugin
func RegisterCustomProvider ¶
RegisterCustomProvider register customer provider
func RegisterSchema ¶
RegisterSchema register schema
func RegisterSchemaWithName ¶
RegisterSchemaWithName register schema with name
Types ¶
type DefaultProvider ¶
type DefaultProvider struct { MicroServiceName string SchemaMap map[string]*Schema //string=schemaID OperationMap map[string]*operation // contains filtered or unexported fields }
DefaultProvider default provider
func (*DefaultProvider) Exist ¶
func (p *DefaultProvider) Exist(schemaID string, operationID string) bool
Exist check the schema, operation is present or not
func (*DefaultProvider) GetOperation ¶
func (p *DefaultProvider) GetOperation(schemaID string, operationID string) (Operation, error)
GetOperation get operation
func (*DefaultProvider) Invoke ¶
func (p *DefaultProvider) Invoke(inv *invocation.Invocation) (interface{}, error)
Invoke is for to invoke the methods of defaultprovider
func (*DefaultProvider) Register ¶
func (p *DefaultProvider) Register(schema interface{}) (string, error)
Register publishes in the server the set of methods of the receiver value that satisfy the following conditions:
- exported method of exported type
- two arguments, both of exported type
- the second argument is a pointer
- one return value, of type error
It returns an error if the receiver is not an exported type or has no suitable methods. It also logs the error using package log. The client accesses each method using a string of the form "Type.Method", where Type is the receiver's concrete type.
func (*DefaultProvider) RegisterName ¶
func (p *DefaultProvider) RegisterName(name string, rcvr interface{}) error
RegisterName is like Register but uses the provided name for the type instead of the receiver's concrete type.
type Provider ¶
type Provider interface { //Register a schema Register(schema interface{}) (string, error) RegisterName(name string, schema interface{}) error //invoke schema function Invoke(inv *invocation.Invocation) (interface{}, error) GetOperation(schemaID string, operationID string) (Operation, error) //if exists in local,for localcall Exist(schemaID, operationID string) bool }
Provider is the interface for schema methods
func GetProvider ¶
GetProvider get provider
func NewProvider ¶
NewProvider returns the object of DefaultProvider
func RegisterProvider ¶
RegisterProvider register provider