Documentation
¶
Index ¶
- Constants
- Variables
- func CloneContext(ctx context.Context) prsim.Context
- func Context() prsim.Context
- func ContextWith(ctx context.Context) prsim.Context
- func CopyContext(ctx context.Context, source map[string]string) prsim.Context
- func Dump(ctx context.Context) map[string]string
- func HTTPTracerContext(r *http.Request) prsim.Context
- func Locale(ctx context.Context) *types.Location
- func NoService(ctx context.Context, urn *types.URN) error
- func TracerContext(traceId string, spanId string) prsim.Context
- func WithContext(ctx context.Context, mtx prsim.Context) context.Context
- type Consumer
- type Digest
- type Eden
- type Execution
- type Filter
- type Generic
- type GenericExecution
- type GenericHandler
- type GenericInspector
- func (that *GenericInspector) Call(ctx context.Context, proxy interface{}, method macro.Inspector, ...) (interface{}, error)
- func (that *GenericInspector) GetBinding() []macro.Binding
- func (that *GenericInspector) GetDeclaredKind() interface{}
- func (that *GenericInspector) GetIntype() macro.Parameters
- func (that *GenericInspector) GetMPI() macro.MPI
- func (that *GenericInspector) GetMPS() macro.MPS
- func (that *GenericInspector) GetName() string
- func (that *GenericInspector) GetRetype() macro.Returns
- func (that *GenericInspector) GetSPI() macro.SPI
- func (that *GenericInspector) GetTName() string
- func (that *GenericInspector) NewInbound() macro.Parameters
- func (that *GenericInspector) NewOutbound() macro.Returns
- func (that *GenericInspector) Signature() string
- func (that *GenericInspector) String() string
- type GenericParameters
- func (that GenericParameters) Get(key string) interface{}
- func (that GenericParameters) GetArguments(ctx context.Context) []interface{}
- func (that GenericParameters) GetAttachments(ctx context.Context) map[string]string
- func (that GenericParameters) GetKind() interface{}
- func (that GenericParameters) PutAll(dict map[string]interface{})
- func (that GenericParameters) SetArguments(ctx context.Context, arguments ...interface{})
- func (that GenericParameters) SetAttachments(ctx context.Context, attachments map[string]string)
- type GenericReturns
- func (that GenericReturns) GetCause(ctx context.Context) *macro.Cause
- func (that GenericReturns) GetCode() string
- func (that GenericReturns) GetContent(ctx context.Context) []interface{}
- func (that GenericReturns) GetMessage() string
- func (that GenericReturns) SetCause(ctx context.Context, cause *macro.Cause)
- func (that GenericReturns) SetCode(code string)
- func (that GenericReturns) SetContent(ctx context.Context, arguments ...interface{})
- func (that GenericReturns) SetMessage(message string)
- type InspectExecution
- func (that *InspectExecution) Call(ctx context.Context, proxy interface{}, method macro.Inspector, ...) (interface{}, error)
- func (that *InspectExecution) GetBinding() []macro.Binding
- func (that *InspectExecution) GetDeclaredKind() interface{}
- func (that *InspectExecution) GetIntype() macro.Parameters
- func (that *InspectExecution) GetMPI() macro.MPI
- func (that *InspectExecution) GetMPS() macro.MPS
- func (that *InspectExecution) GetName() string
- func (that *InspectExecution) GetRetype() macro.Returns
- func (that *InspectExecution) GetSPI() macro.SPI
- func (that *InspectExecution) GetTName() string
- func (that *InspectExecution) Inspect() macro.Inspector
- func (that *InspectExecution) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
- func (that *InspectExecution) NewInbound() macro.Parameters
- func (that *InspectExecution) NewOutbound() macro.Returns
- func (that *InspectExecution) Schema() Generic
- func (that *InspectExecution) Signature() string
- func (that *InspectExecution) String() string
- type Invocation
- type InvocationRuntime
- type Invoker
- type InvokerDecorator
- type InvokerFn
- type MeshContext
- func (that *MeshContext) Deadline() (deadline time.Time, ok bool)
- func (that *MeshContext) Done() <-chan struct{}
- func (that *MeshContext) Err() error
- func (that *MeshContext) GetAttachment(name string) string
- func (that *MeshContext) GetAttachments() map[string]string
- func (that *MeshContext) GetAttribute(key *prsim.Key) interface{}
- func (that *MeshContext) GetAttributes() map[string]interface{}
- func (that *MeshContext) GetConsumer(ctx context.Context) *types.Location
- func (that *MeshContext) GetPrincipals() *prsim.Deque[*types.Principal]
- func (that *MeshContext) GetProvider(ctx context.Context) *types.Location
- func (that *MeshContext) GetRunMode() int
- func (that *MeshContext) GetSpanId() string
- func (that *MeshContext) GetTimestamp() int64
- func (that *MeshContext) GetTraceId() string
- func (that *MeshContext) GetUrn() string
- func (that *MeshContext) Resume(ctx context.Context) prsim.Context
- func (that *MeshContext) RewriteContext(context prsim.Context)
- func (that *MeshContext) RewriteURN(urn string)
- func (that *MeshContext) SetAttribute(key *prsim.Key, value interface{})
- func (that *MeshContext) Value(key interface{}) interface{}
- func (that *MeshContext) WithTimeout(timeout time.Duration) context.CancelFunc
- type MeshEden
- func (that *MeshEden) Att() *macro.Att
- func (that *MeshEden) Btt() []*macro.Btt
- func (that *MeshEden) Define(ctx context.Context, mpi macro.MPI, reference any) error
- func (that *MeshEden) Infer(ctx context.Context, urn string) (Execution, error)
- func (that *MeshEden) InferTypes(ctx context.Context) ([]macro.MPS, error)
- func (that *MeshEden) Listen(ctx context.Context, event *types.Event) error
- func (that *MeshEden) Refer(ctx context.Context, mpi macro.MPI, reference any, method macro.Inspector) (Execution, error)
- func (that *MeshEden) ReferTypes(ctx context.Context) ([]macro.MPI, error)
- func (that *MeshEden) Refresh(ctx context.Context, runtime prsim.Runtime) error
- func (that *MeshEden) Start(ctx context.Context, runtime prsim.Runtime) error
- func (that *MeshEden) Stop(ctx context.Context, runtime prsim.Runtime) error
- func (that *MeshEden) Store(ctx context.Context, kind any, service any) error
- type Provider
- type Referencable
- type ReferenceHandler
- func (that *ReferenceHandler) Call(ctx context.Context, proxy interface{}, method macro.Inspector, ...) (interface{}, error)
- func (that *ReferenceHandler) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
- func (that *ReferenceHandler) ReferExecution(ctx context.Context, inspector macro.Inspector) (Execution, error)
- type ServiceHandler
- type ServiceInvocation
- func (that *ServiceInvocation) GetArguments(ctx context.Context) []interface{}
- func (that *ServiceInvocation) GetAttachments(ctx context.Context) map[string]string
- func (that *ServiceInvocation) GetBuffer() *bytes.Buffer
- func (that *ServiceInvocation) GetExecution() Execution
- func (that *ServiceInvocation) GetInspector() macro.Inspector
- func (that *ServiceInvocation) GetParameters() macro.Parameters
- func (that *ServiceInvocation) GetProxy() Invoker
- func (that *ServiceInvocation) GetURN() *types.URN
Constants ¶
View Source
const ( // PROVIDER Flag. PROVIDER = "PROVIDER" // CONSUMER Flag. CONSUMER = "CONSUMER" )
Variables ¶
View Source
var ( TimeoutKey = &prsim.Key{Name: "mesh.mpc.timeout", Dft: func() interface{} { return time.Second * 10 }} AddressKey = &prsim.Key{Name: "mesh.mpc.address", Dft: func() interface{} { return "" }} InsecureKey = &prsim.Key{Name: "mesh.mpc.insecure", Dft: func() interface{} { return true }} CertificateKey = &prsim.Key{Name: "mesh.mpc.certificate", Dft: func() interface{} { return &tls.Config{} }} RemoteUname = &prsim.Key{Name: "mesh.mpc.uname", Dft: func() interface{} { return "" }} RemoteName = &prsim.Key{Name: "mesh.mpc.name", Dft: func() interface{} { return "" }} HeaderKey = &prsim.Key{Name: "mesh.mpc.headers", Dft: func() interface{} { return map[string]string{} }} )
View Source
var ConsumerKey = &prsim.Key{Name: "mesh.mpc.Consumer", Dft: func() interface{} { return nil }}
View Source
var IConsumer = (*Consumer)(nil)
View Source
var IEden = (*Eden)(nil)
View Source
var IFilter = (*Filter)(nil)
View Source
var IInvoker = (*Invoker)(nil)
View Source
var IProvider = (*Provider)(nil)
View Source
var MeshFlag = struct { HTTP codename GRPC codename MQTT codename TCP codename JSON codename PROTOBUF codename XML codename THRIFT codename YAML codename OfProto func(code string) codename OfCodec func(code string) codename OfName func(name string) codename }{ HTTP: &meshFlag{code: "00", name: "http"}, GRPC: &meshFlag{code: "01", name: "grpc"}, MQTT: &meshFlag{code: "02", name: "mqtt"}, TCP: &meshFlag{code: "03", name: "tcp"}, JSON: &meshFlag{code: "00", name: "json"}, PROTOBUF: &meshFlag{code: "01", name: "protobuf"}, XML: &meshFlag{code: "02", name: "xml"}, THRIFT: &meshFlag{code: "03", name: "thrift"}, YAML: &meshFlag{code: "04", name: "yaml"}, }
View Source
var ServiceProxy = new(serviceProxy)
Functions ¶
Types ¶
type Consumer ¶
type Consumer interface { // Start the mesh broker. Start() error // Consume the input payload. // urn Actual uniform resource Domain Name. // execution Service reference. // inbound Input arguments. // Output payload Consume(ctx context.Context, urn string, execution Execution, inbound *bytes.Buffer) (*bytes.Buffer, error) // Closer is release hook io.Closer }
type Digest ¶
type Eden ¶
type Eden interface { // Define the reference object. Define(ctx context.Context, mpi macro.MPI, reference interface{}) error // Refer the service reference by method. Refer(ctx context.Context, mpi macro.MPI, reference interface{}, method macro.Inspector) (Execution, error) // Store the service object. Store(ctx context.Context, kind interface{}, service interface{}) error // Infer the reference service by Domain. Infer(ctx context.Context, urn string) (Execution, error) // ReferTypes Get all reference types. ReferTypes(ctx context.Context) ([]macro.MPI, error) // InferTypes Get all service types. InferTypes(ctx context.Context) ([]macro.MPS, error) }
Eden @SPI("mesh")
type GenericExecution ¶
type GenericExecution struct {
// contains filtered or unexported fields
}
func (*GenericExecution) Init ¶
func (that *GenericExecution) Init(urn *types.URN, arguments map[string]interface{})
func (*GenericExecution) Inspect ¶
func (that *GenericExecution) Inspect() macro.Inspector
func (*GenericExecution) Invoke ¶
func (that *GenericExecution) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
func (*GenericExecution) Schema ¶
func (that *GenericExecution) Schema() Generic
type GenericHandler ¶
type GenericHandler struct {
ReferenceHandler
}
func (*GenericHandler) ReferExecution ¶
type GenericInspector ¶
func (*GenericInspector) GetBinding ¶
func (that *GenericInspector) GetBinding() []macro.Binding
func (*GenericInspector) GetDeclaredKind ¶
func (that *GenericInspector) GetDeclaredKind() interface{}
func (*GenericInspector) GetIntype ¶
func (that *GenericInspector) GetIntype() macro.Parameters
func (*GenericInspector) GetMPI ¶
func (that *GenericInspector) GetMPI() macro.MPI
func (*GenericInspector) GetMPS ¶
func (that *GenericInspector) GetMPS() macro.MPS
func (*GenericInspector) GetName ¶
func (that *GenericInspector) GetName() string
func (*GenericInspector) GetRetype ¶
func (that *GenericInspector) GetRetype() macro.Returns
func (*GenericInspector) GetSPI ¶
func (that *GenericInspector) GetSPI() macro.SPI
func (*GenericInspector) GetTName ¶
func (that *GenericInspector) GetTName() string
func (*GenericInspector) NewInbound ¶
func (that *GenericInspector) NewInbound() macro.Parameters
func (*GenericInspector) NewOutbound ¶
func (that *GenericInspector) NewOutbound() macro.Returns
func (*GenericInspector) Signature ¶
func (that *GenericInspector) Signature() string
func (*GenericInspector) String ¶
func (that *GenericInspector) String() string
type GenericParameters ¶
type GenericParameters map[string]interface{}
func (GenericParameters) Get ¶
func (that GenericParameters) Get(key string) interface{}
func (GenericParameters) GetArguments ¶
func (that GenericParameters) GetArguments(ctx context.Context) []interface{}
func (GenericParameters) GetAttachments ¶
func (that GenericParameters) GetAttachments(ctx context.Context) map[string]string
func (GenericParameters) GetKind ¶
func (that GenericParameters) GetKind() interface{}
func (GenericParameters) PutAll ¶
func (that GenericParameters) PutAll(dict map[string]interface{})
func (GenericParameters) SetArguments ¶
func (that GenericParameters) SetArguments(ctx context.Context, arguments ...interface{})
func (GenericParameters) SetAttachments ¶
func (that GenericParameters) SetAttachments(ctx context.Context, attachments map[string]string)
type GenericReturns ¶
type GenericReturns map[string]interface{}
func (GenericReturns) GetCause ¶
func (that GenericReturns) GetCause(ctx context.Context) *macro.Cause
func (GenericReturns) GetCode ¶
func (that GenericReturns) GetCode() string
func (GenericReturns) GetContent ¶
func (that GenericReturns) GetContent(ctx context.Context) []interface{}
func (GenericReturns) GetMessage ¶
func (that GenericReturns) GetMessage() string
func (GenericReturns) SetCause ¶
func (that GenericReturns) SetCause(ctx context.Context, cause *macro.Cause)
func (GenericReturns) SetCode ¶
func (that GenericReturns) SetCode(code string)
func (GenericReturns) SetContent ¶
func (that GenericReturns) SetContent(ctx context.Context, arguments ...interface{})
func (GenericReturns) SetMessage ¶
func (that GenericReturns) SetMessage(message string)
type InspectExecution ¶
func (*InspectExecution) GetBinding ¶
func (that *InspectExecution) GetBinding() []macro.Binding
func (*InspectExecution) GetDeclaredKind ¶
func (that *InspectExecution) GetDeclaredKind() interface{}
func (*InspectExecution) GetIntype ¶
func (that *InspectExecution) GetIntype() macro.Parameters
func (*InspectExecution) GetMPI ¶
func (that *InspectExecution) GetMPI() macro.MPI
func (*InspectExecution) GetMPS ¶
func (that *InspectExecution) GetMPS() macro.MPS
func (*InspectExecution) GetName ¶
func (that *InspectExecution) GetName() string
func (*InspectExecution) GetRetype ¶
func (that *InspectExecution) GetRetype() macro.Returns
func (*InspectExecution) GetSPI ¶
func (that *InspectExecution) GetSPI() macro.SPI
func (*InspectExecution) GetTName ¶
func (that *InspectExecution) GetTName() string
func (*InspectExecution) Inspect ¶
func (that *InspectExecution) Inspect() macro.Inspector
func (*InspectExecution) Invoke ¶
func (that *InspectExecution) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
func (*InspectExecution) NewInbound ¶
func (that *InspectExecution) NewInbound() macro.Parameters
func (*InspectExecution) NewOutbound ¶
func (that *InspectExecution) NewOutbound() macro.Returns
func (*InspectExecution) Schema ¶
func (that *InspectExecution) Schema() Generic
func (*InspectExecution) Signature ¶
func (that *InspectExecution) Signature() string
func (*InspectExecution) String ¶
func (that *InspectExecution) String() string
type Invocation ¶
type Invocation interface { // GetProxy the delegate target object. GetProxy() Invoker // GetInspector interface. GetInspector() macro.Inspector // GetParameters parameters. GetParameters() macro.Parameters // GetArguments parameters. GetArguments(ctx context.Context) []interface{} // GetAttachments the attachments. The attributes will be serialized. GetAttachments(ctx context.Context) map[string]string // GetBuffer get the input buffer. GetBuffer() *bytes.Buffer // GetExecution get the invocation execution. GetExecution() Execution // GetURN get the invoked urn. GetURN() *types.URN }
type InvocationRuntime ¶
type InvocationRuntime struct {
// contains filtered or unexported fields
}
func (*InvocationRuntime) Dispatch ¶
func (that *InvocationRuntime) Dispatch(ctx context.Context, name string, args ...interface{}) (interface{}, error)
func (*InvocationRuntime) Parse ¶
func (that *InvocationRuntime) Parse(ctx context.Context, ptr interface{}) error
func (*InvocationRuntime) ParseHeader ¶
type Invoker ¶
type Invoker interface { // Invoke the next invoker. Invoke(ctx context.Context, invocation Invocation) (interface{}, error) }
type InvokerDecorator ¶
func (*InvokerDecorator) Att ¶
func (that *InvokerDecorator) Att() *macro.Att
func (*InvokerDecorator) Invoke ¶
func (that *InvokerDecorator) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
type InvokerFn ¶
type InvokerFn func(ctx context.Context, invocation Invocation) (interface{}, error)
type MeshContext ¶
type MeshContext struct { Context context.Context TraceId string SpanId string Timestamp int64 RunMode int URN string Consumer *types.Location Attachments map[string]string Attributes map[string]interface{} Principals *prsim.Deque[*types.Principal] // contains filtered or unexported fields }
func (*MeshContext) Done ¶
func (that *MeshContext) Done() <-chan struct{}
func (*MeshContext) Err ¶
func (that *MeshContext) Err() error
func (*MeshContext) GetAttachment ¶
func (that *MeshContext) GetAttachment(name string) string
func (*MeshContext) GetAttachments ¶
func (that *MeshContext) GetAttachments() map[string]string
func (*MeshContext) GetAttribute ¶
func (that *MeshContext) GetAttribute(key *prsim.Key) interface{}
func (*MeshContext) GetAttributes ¶
func (that *MeshContext) GetAttributes() map[string]interface{}
func (*MeshContext) GetConsumer ¶
func (that *MeshContext) GetConsumer(ctx context.Context) *types.Location
func (*MeshContext) GetPrincipals ¶
func (that *MeshContext) GetPrincipals() *prsim.Deque[*types.Principal]
func (*MeshContext) GetProvider ¶
func (that *MeshContext) GetProvider(ctx context.Context) *types.Location
func (*MeshContext) GetRunMode ¶
func (that *MeshContext) GetRunMode() int
func (*MeshContext) GetSpanId ¶
func (that *MeshContext) GetSpanId() string
func (*MeshContext) GetTimestamp ¶
func (that *MeshContext) GetTimestamp() int64
func (*MeshContext) GetTraceId ¶
func (that *MeshContext) GetTraceId() string
func (*MeshContext) GetUrn ¶
func (that *MeshContext) GetUrn() string
func (*MeshContext) RewriteContext ¶
func (that *MeshContext) RewriteContext(context prsim.Context)
func (*MeshContext) RewriteURN ¶
func (that *MeshContext) RewriteURN(urn string)
func (*MeshContext) SetAttribute ¶
func (that *MeshContext) SetAttribute(key *prsim.Key, value interface{})
func (*MeshContext) Value ¶
func (that *MeshContext) Value(key interface{}) interface{}
func (*MeshContext) WithTimeout ¶
func (that *MeshContext) WithTimeout(timeout time.Duration) context.CancelFunc
type MeshEden ¶
type MeshEden struct {
// contains filtered or unexported fields
}
func (*MeshEden) InferTypes ¶
func (*MeshEden) ReferTypes ¶
type Referencable ¶
type ReferenceHandler ¶
func (*ReferenceHandler) Invoke ¶
func (that *ReferenceHandler) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
func (*ReferenceHandler) ReferExecution ¶
type ServiceHandler ¶
type ServiceHandler struct {
// contains filtered or unexported fields
}
func (*ServiceHandler) Invoke ¶
func (that *ServiceHandler) Invoke(ctx context.Context, invocation Invocation) (interface{}, error)
type ServiceInvocation ¶
type ServiceInvocation struct { Proxy Invoker Inspector macro.Inspector Parameters macro.Parameters Buffer *bytes.Buffer Execution Execution URN *types.URN }
func (*ServiceInvocation) GetArguments ¶
func (that *ServiceInvocation) GetArguments(ctx context.Context) []interface{}
func (*ServiceInvocation) GetAttachments ¶
func (that *ServiceInvocation) GetAttachments(ctx context.Context) map[string]string
func (*ServiceInvocation) GetBuffer ¶
func (that *ServiceInvocation) GetBuffer() *bytes.Buffer
func (*ServiceInvocation) GetExecution ¶
func (that *ServiceInvocation) GetExecution() Execution
func (*ServiceInvocation) GetInspector ¶
func (that *ServiceInvocation) GetInspector() macro.Inspector
func (*ServiceInvocation) GetParameters ¶
func (that *ServiceInvocation) GetParameters() macro.Parameters
func (*ServiceInvocation) GetProxy ¶
func (that *ServiceInvocation) GetProxy() Invoker
func (*ServiceInvocation) GetURN ¶
func (that *ServiceInvocation) GetURN() *types.URN
Source Files
¶
- consumer.go
- consumer_filter.go
- digest.go
- eden.go
- execution.go
- filter.go
- generic_execution.go
- generic_handler.go
- generic_inspector.go
- generic_parameters.go
- generic_returns.go
- inspect_execution.go
- invocation.go
- invoker.go
- mesh_context.go
- mesh_eden.go
- mesh_flag.go
- provider.go
- provider_filter.go
- reference_handler.go
- robust_filter.go
- runtime.go
- service_handler.go
- serviceproxy.go
Click to show internal directories.
Click to hide internal directories.