Documentation
¶
Index ¶
- func MakeHandlerJSONRPC(svcInterfaceA InterfaceA, svcInterfaceB InterfaceB, options ...ServerOption) (http.Handler, error)
- func MakeInterfaceAEndpointCodecMap(ep InterfaceAEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
- func MakeInterfaceATestMethodEndpoint(s InterfaceA) endpoint.Endpoint
- func MakeInterfaceBCreateEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeInterfaceBDeleteEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeInterfaceBEndpointCodecMap(ep InterfaceBEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
- func MakeInterfaceBGetAllEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeInterfaceBGetEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeInterfaceBTestMethod2Endpoint(s InterfaceB) endpoint.Endpoint
- func MakeInterfaceBTestMethodEndpoint(s InterfaceB) endpoint.Endpoint
- func MergeEndpointCodecMaps(ecms ...jsonrpc.EndpointCodecMap) jsonrpc.EndpointCodecMap
- type AInstrumentingMiddleware
- type ALoggingMiddleware
- type AliasData
- type AppClient
- type BInstrumentingMiddleware
- func (s *BInstrumentingMiddleware) Create(ctx context.Context, newData Data, name string, data []byte) error
- func (s *BInstrumentingMiddleware) Delete(ctx context.Context, id uint) (string, string, error)
- func (s *BInstrumentingMiddleware) Get(ctx context.Context, id int, name string, fname string, price float32, n int, ...) (User, error)
- func (s *BInstrumentingMiddleware) GetAll(ctx context.Context, members Members) ([]*User, error)
- func (s *BInstrumentingMiddleware) TestMethod(data map[string]interface{}, ss interface{}) (map[string]map[int][]string, error)
- func (s *BInstrumentingMiddleware) TestMethod2(ctx context.Context, ns string, utype string, user string, restype string, ...) error
- type BLoggingMiddleware
- func (s *BLoggingMiddleware) Create(ctx context.Context, newData Data, name string, data []byte) error
- func (s *BLoggingMiddleware) Delete(ctx context.Context, id uint) (string, string, error)
- func (s *BLoggingMiddleware) Get(ctx context.Context, id int, name string, fname string, price float32, n int, ...) (User, error)
- func (s *BLoggingMiddleware) GetAll(ctx context.Context, members Members) ([]*User, error)
- func (s *BLoggingMiddleware) TestMethod(data map[string]interface{}, ss interface{}) (map[string]map[int][]string, error)
- func (s *BLoggingMiddleware) TestMethod2(ctx context.Context, ns string, utype string, user string, restype string, ...) error
- type ClientOption
- func GenericClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func GenericClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceATestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceATestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBCreateClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBCreateClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBDeleteClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBDeleteClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBGetAllClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBGetAllClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBGetClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBGetClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBTestMethod2ClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBTestMethod2ClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func InterfaceBTestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func InterfaceBTestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- type Data
- type ErrForbidden
- type ErrUnauthorized
- type GeoJSON
- type Info
- type InstrumentingOption
- type InterfaceA
- func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceA, error)
- func NewClientJSONRPCInterfaceA(tgt string, options ...ClientOption) (InterfaceA, error)
- func NewInstrumentingAMiddleware(s InterfaceA, opts ...InstrumentingOption) InterfaceA
- func NewLoggingAMiddleware(s InterfaceA, logger log.Logger) InterfaceA
- type InterfaceAEndpointSet
- type InterfaceB
- func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceB, error)
- func NewClientJSONRPCInterfaceB(tgt string, options ...ClientOption) (InterfaceB, error)
- func NewInstrumentingBMiddleware(s InterfaceB, opts ...InstrumentingOption) InterfaceB
- func NewLoggingBMiddleware(s InterfaceB, logger log.Logger) InterfaceB
- type InterfaceBCreateRequest
- type InterfaceBDeleteRequest
- type InterfaceBDeleteResponse
- type InterfaceBEndpointSet
- type InterfaceBGetAllRequest
- type InterfaceBGetRequest
- type InterfaceBTestMethod2Request
- type InterfaceBTestMethodRequest
- type Member
- type Members
- type Profile
- type Recurse
- type ServerOption
- func GenericServerEndpointMiddlewares(v ...endpoint.Middleware) ServerOption
- func GenericServerOptions(v ...jsonrpc.ServerOption) ServerOption
- func InterfaceATestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceATestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBCreateServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBCreateServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBDeleteServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBDeleteServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBGetAllServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBGetAllServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBGetServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBGetServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBTestMethod2ServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBTestMethod2ServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func InterfaceBTestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func InterfaceBTestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeHandlerJSONRPC ¶
func MakeHandlerJSONRPC(svcInterfaceA InterfaceA, svcInterfaceB InterfaceB, options ...ServerOption) (http.Handler, error)
HTTP JSONRPC Transport
func MakeInterfaceAEndpointCodecMap ¶
func MakeInterfaceAEndpointCodecMap(ep InterfaceAEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
func MakeInterfaceATestMethodEndpoint ¶
func MakeInterfaceATestMethodEndpoint(s InterfaceA) endpoint.Endpoint
func MakeInterfaceBCreateEndpoint ¶
func MakeInterfaceBCreateEndpoint(s InterfaceB) endpoint.Endpoint
func MakeInterfaceBDeleteEndpoint ¶
func MakeInterfaceBDeleteEndpoint(s InterfaceB) endpoint.Endpoint
func MakeInterfaceBEndpointCodecMap ¶
func MakeInterfaceBEndpointCodecMap(ep InterfaceBEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
func MakeInterfaceBGetAllEndpoint ¶
func MakeInterfaceBGetAllEndpoint(s InterfaceB) endpoint.Endpoint
func MakeInterfaceBGetEndpoint ¶
func MakeInterfaceBGetEndpoint(s InterfaceB) endpoint.Endpoint
func MakeInterfaceBTestMethod2Endpoint ¶
func MakeInterfaceBTestMethod2Endpoint(s InterfaceB) endpoint.Endpoint
func MakeInterfaceBTestMethodEndpoint ¶
func MakeInterfaceBTestMethodEndpoint(s InterfaceB) endpoint.Endpoint
func MergeEndpointCodecMaps ¶
func MergeEndpointCodecMaps(ecms ...jsonrpc.EndpointCodecMap) jsonrpc.EndpointCodecMap
Types ¶
type AInstrumentingMiddleware ¶
type AInstrumentingMiddleware struct {
// contains filtered or unexported fields
}
func (*AInstrumentingMiddleware) TestMethod ¶
func (s *AInstrumentingMiddleware) TestMethod()
type ALoggingMiddleware ¶
type ALoggingMiddleware struct {
// contains filtered or unexported fields
}
func (*ALoggingMiddleware) TestMethod ¶
func (s *ALoggingMiddleware) TestMethod()
type AppClient ¶
type AppClient struct { AClient InterfaceA BClient InterfaceB }
func NewClientJSONRPC ¶
func NewClientJSONRPC(tgt string, opts ...ClientOption) (*AppClient, error)
type BInstrumentingMiddleware ¶
type BInstrumentingMiddleware struct {
// contains filtered or unexported fields
}
func (*BInstrumentingMiddleware) TestMethod ¶
type BLoggingMiddleware ¶
type BLoggingMiddleware struct {
// contains filtered or unexported fields
}
func (*BLoggingMiddleware) TestMethod ¶
type ClientOption ¶
type ClientOption func(*clientOpts)
func GenericClientEndpointMiddlewares ¶
func GenericClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func GenericClientOptions ¶
func GenericClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceATestMethodClientEndpointMiddlewares ¶
func InterfaceATestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceATestMethodClientOptions ¶
func InterfaceATestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBCreateClientEndpointMiddlewares ¶
func InterfaceBCreateClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBCreateClientOptions ¶
func InterfaceBCreateClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBDeleteClientEndpointMiddlewares ¶
func InterfaceBDeleteClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBDeleteClientOptions ¶
func InterfaceBDeleteClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBGetAllClientEndpointMiddlewares ¶
func InterfaceBGetAllClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBGetAllClientOptions ¶
func InterfaceBGetAllClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBGetClientEndpointMiddlewares ¶
func InterfaceBGetClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBGetClientOptions ¶
func InterfaceBGetClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBTestMethod2ClientEndpointMiddlewares ¶
func InterfaceBTestMethod2ClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBTestMethod2ClientOptions ¶
func InterfaceBTestMethod2ClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func InterfaceBTestMethodClientEndpointMiddlewares ¶
func InterfaceBTestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func InterfaceBTestMethodClientOptions ¶
func InterfaceBTestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
type ErrForbidden ¶
type ErrForbidden struct{}
ErrForbidden forbidden.
func (ErrForbidden) Error ¶
func (ErrForbidden) Error() string
func (ErrForbidden) ErrorCode ¶
func (ErrForbidden) ErrorCode() int
ErrorCode error value implements ErrorCoder, the ErrorCode will be used when encoding the error.
func (ErrForbidden) StatusCode ¶
func (ErrForbidden) StatusCode() int
StatusCode error value implements StatusCoder, the StatusCode will be used when encoding the error.
type ErrUnauthorized ¶
type ErrUnauthorized struct{}
ErrUnauthorized unauthorized.
func (ErrUnauthorized) Error ¶
func (ErrUnauthorized) Error() string
func (ErrUnauthorized) ErrorCode ¶
func (ErrUnauthorized) ErrorCode() int
ErrorCode error value implements ErrorCoder, the ErrorCode will be used when encoding the error.
func (ErrUnauthorized) StatusCode ¶
func (ErrUnauthorized) StatusCode() int
StatusCode error value implements StatusCoder, the StatusCode will be used when encoding the error.
type InstrumentingOption ¶
type InstrumentingOption func(*instrumentingOpts)
func Namespace ¶
func Namespace(v string) InstrumentingOption
func RequestCount ¶
func RequestCount(requestCount metrics.Counter) InstrumentingOption
func RequestLatency ¶
func RequestLatency(requestLatency metrics.Histogram) InstrumentingOption
func Subsystem ¶
func Subsystem(v string) InstrumentingOption
type InterfaceA ¶
type InterfaceA interface {
TestMethod()
}
func NewClientJSONRPC ¶
func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceA, error)
Deprecated
func NewClientJSONRPCInterfaceA ¶
func NewClientJSONRPCInterfaceA(tgt string, options ...ClientOption) (InterfaceA, error)
func NewInstrumentingAMiddleware ¶
func NewInstrumentingAMiddleware(s InterfaceA, opts ...InstrumentingOption) InterfaceA
func NewLoggingAMiddleware ¶
func NewLoggingAMiddleware(s InterfaceA, logger log.Logger) InterfaceA
type InterfaceAEndpointSet ¶
func MakeInterfaceAEndpointSet ¶
func MakeInterfaceAEndpointSet(svc InterfaceA) InterfaceAEndpointSet
type InterfaceB ¶
type InterfaceB interface { // Create new item of item. Create(ctx context.Context, newData AliasData, name string, data []byte) (err error) // Get item. Get(ctx context.Context, id int, name, fname string, price float32, n, b, cc int) (data User, err error) // GetAll more comment and more and more comment and more and more comment and more. // New line comment. GetAll(ctx context.Context, members Members) ([]*User, error) Delete(ctx context.Context, id uint) (a string, b string, err error) TestMethod(data map[string]interface{}, ss interface{}) (states map[string]map[int][]string, err error) TestMethod2(ctx context.Context, ns string, utype string, user string, restype string, resource string, permission string) error }
func NewClientJSONRPC ¶
func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceB, error)
Deprecated
func NewClientJSONRPCInterfaceB ¶
func NewClientJSONRPCInterfaceB(tgt string, options ...ClientOption) (InterfaceB, error)
func NewInstrumentingBMiddleware ¶
func NewInstrumentingBMiddleware(s InterfaceB, opts ...InstrumentingOption) InterfaceB
func NewLoggingBMiddleware ¶
func NewLoggingBMiddleware(s InterfaceB, logger log.Logger) InterfaceB
type InterfaceBCreateRequest ¶
type InterfaceBDeleteRequest ¶
type InterfaceBDeleteRequest struct {
Id uint `json:"id"`
}
type InterfaceBEndpointSet ¶
type InterfaceBEndpointSet struct { CreateEndpoint endpoint.Endpoint DeleteEndpoint endpoint.Endpoint GetEndpoint endpoint.Endpoint GetAllEndpoint endpoint.Endpoint TestMethodEndpoint endpoint.Endpoint TestMethod2Endpoint endpoint.Endpoint }
func MakeInterfaceBEndpointSet ¶
func MakeInterfaceBEndpointSet(svc InterfaceB) InterfaceBEndpointSet
type InterfaceBGetAllRequest ¶
type InterfaceBGetAllRequest struct {
Members Members `json:"members"`
}
type InterfaceBGetRequest ¶
type InterfaceBTestMethodRequest ¶
type InterfaceBTestMethodRequest struct { Data map[string]interface{} `json:"data"` Ss interface{} `json:"ss"` }
type ServerOption ¶
type ServerOption func(*serverOpts)
func GenericServerEndpointMiddlewares ¶
func GenericServerEndpointMiddlewares(v ...endpoint.Middleware) ServerOption
func GenericServerOptions ¶
func GenericServerOptions(v ...jsonrpc.ServerOption) ServerOption
func InterfaceATestMethodServerEndpointMiddlewares ¶
func InterfaceATestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceATestMethodServerOptions ¶
func InterfaceATestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBCreateServerEndpointMiddlewares ¶
func InterfaceBCreateServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBCreateServerOptions ¶
func InterfaceBCreateServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBDeleteServerEndpointMiddlewares ¶
func InterfaceBDeleteServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBDeleteServerOptions ¶
func InterfaceBDeleteServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBGetAllServerEndpointMiddlewares ¶
func InterfaceBGetAllServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBGetAllServerOptions ¶
func InterfaceBGetAllServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBGetServerEndpointMiddlewares ¶
func InterfaceBGetServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBGetServerOptions ¶
func InterfaceBGetServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBTestMethod2ServerEndpointMiddlewares ¶
func InterfaceBTestMethod2ServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBTestMethod2ServerOptions ¶
func InterfaceBTestMethod2ServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func InterfaceBTestMethodServerEndpointMiddlewares ¶
func InterfaceBTestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func InterfaceBTestMethodServerOptions ¶
func InterfaceBTestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
type User ¶
type User struct { *Info ID uuid.UUID `json:"id"` Name string `json:"name"` Password string `json:"password"` Point GeoJSON `json:"point"` LastSeen time.Time `json:"last_seen"` Data AliasData `json:"data"` Photo []byte `json:"photo"` User *User `json:"user"` //Users []*User `json:"users"` Profile *Profile `json:"profile"` Recurse *Recurse `json:"recurse"` CreatedAt *time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.