Documentation
¶
Index ¶
- func MakeHandlerJSONRPC(svcService InterfaceB, options ...ServerOption) (http.Handler, error)
- func MakeServiceCreateEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceDeleteEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceEndpointCodecMap(ep ServiceEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
- func MakeServiceGetAllEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceGetEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceTestMethod2Endpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceTestMethodEndpoint(s InterfaceB) endpoint.Endpoint
- func MakeServiceTestMethodOptionalsEndpoint(s InterfaceB) endpoint.Endpoint
- func MergeEndpointCodecMaps(ecms ...jsonrpc.EndpointCodecMap) jsonrpc.EndpointCodecMap
- type AliasData
- type ClientOption
- func GenericClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func GenericClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceCreateClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceCreateClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceDeleteClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceDeleteClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceGetAllClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceGetAllClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceGetClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceGetClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceTestMethod2ClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceTestMethod2ClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceTestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceTestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- func ServiceTestMethodOptionalsClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
- func ServiceTestMethodOptionalsClientOptions(opt ...jsonrpc.ClientOption) ClientOption
- type CreateRequest
- type Data
- type DeleteRequest
- type DeleteResponse
- type ErrForbidden
- type ErrUnauthorized
- type GeoJSON
- type GetAllRequest
- type GetRequest
- type InstrumentingOption
- type InterfaceB
- func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceB, error)
- func NewClientJSONRPCService(tgt string, options ...ClientOption) (InterfaceB, error)
- func NewInstrumentingServiceMiddleware(s InterfaceB, opts ...InstrumentingOption) InterfaceB
- func NewLoggingServiceMiddleware(s InterfaceB, logger log.Logger) InterfaceB
- type Kind
- type Member
- type Members
- type OptionService
- type Profile
- type Recurse
- type ServerOption
- func GenericServerEndpointMiddlewares(v ...endpoint.Middleware) ServerOption
- func GenericServerOptions(v ...jsonrpc.ServerOption) ServerOption
- func ServiceCreateServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceCreateServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceDeleteServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceDeleteServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceGetAllServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceGetAllServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceGetServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceGetServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceTestMethod2ServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceTestMethod2ServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceTestMethodOptionalsServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceTestMethodOptionalsServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- func ServiceTestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
- func ServiceTestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
- type ServiceEndpointSet
- type ServiceInstrumentingMiddleware
- func (s *ServiceInstrumentingMiddleware) Create(ctx context.Context, newData Data, name string, data []byte) error
- func (s *ServiceInstrumentingMiddleware) Delete(ctx context.Context, id uint) (string, string, error)
- func (s *ServiceInstrumentingMiddleware) Get(ctx context.Context, id uuid.UUID, name string, fname string, price float32, ...) (User, error)
- func (s *ServiceInstrumentingMiddleware) GetAll(ctx context.Context, members Members) ([]*User, error)
- func (s *ServiceInstrumentingMiddleware) TestMethod(data map[string]interface{}, ss interface{}) (map[string]map[int][]string, error)
- func (s *ServiceInstrumentingMiddleware) TestMethod2(ctx context.Context, ns string, utype string, user string, restype string, ...) error
- func (s *ServiceInstrumentingMiddleware) TestMethodOptionals(ctx context.Context, ns string, options ...OptionService) error
- type ServiceLoggingMiddleware
- func (s *ServiceLoggingMiddleware) Create(ctx context.Context, newData Data, name string, data []byte) error
- func (s *ServiceLoggingMiddleware) Delete(ctx context.Context, id uint) (string, string, error)
- func (s *ServiceLoggingMiddleware) Get(ctx context.Context, id uuid.UUID, name string, fname string, price float32, ...) (User, error)
- func (s *ServiceLoggingMiddleware) GetAll(ctx context.Context, members Members) ([]*User, error)
- func (s *ServiceLoggingMiddleware) TestMethod(data map[string]interface{}, ss interface{}) (map[string]map[int][]string, error)
- func (s *ServiceLoggingMiddleware) TestMethod2(ctx context.Context, ns string, utype string, user string, restype string, ...) error
- func (s *ServiceLoggingMiddleware) TestMethodOptionals(ctx context.Context, ns string, options ...OptionService) error
- type TestMethod2Request
- type TestMethodOptionalsRequest
- type TestMethodRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeHandlerJSONRPC ¶
func MakeHandlerJSONRPC(svcService InterfaceB, options ...ServerOption) (http.Handler, error)
HTTP JSONRPC Transport
func MakeServiceCreateEndpoint ¶
func MakeServiceCreateEndpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceDeleteEndpoint ¶
func MakeServiceDeleteEndpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceEndpointCodecMap ¶
func MakeServiceEndpointCodecMap(ep ServiceEndpointSet, ns ...string) jsonrpc.EndpointCodecMap
func MakeServiceGetAllEndpoint ¶
func MakeServiceGetAllEndpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceGetEndpoint ¶
func MakeServiceGetEndpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceTestMethod2Endpoint ¶
func MakeServiceTestMethod2Endpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceTestMethodEndpoint ¶
func MakeServiceTestMethodEndpoint(s InterfaceB) endpoint.Endpoint
func MakeServiceTestMethodOptionalsEndpoint ¶
func MakeServiceTestMethodOptionalsEndpoint(s InterfaceB) endpoint.Endpoint
func MergeEndpointCodecMaps ¶
func MergeEndpointCodecMaps(ecms ...jsonrpc.EndpointCodecMap) jsonrpc.EndpointCodecMap
Types ¶
type ClientOption ¶
type ClientOption func(*clientOpts)
func GenericClientEndpointMiddlewares ¶
func GenericClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func GenericClientOptions ¶
func GenericClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceCreateClientEndpointMiddlewares ¶
func ServiceCreateClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceCreateClientOptions ¶
func ServiceCreateClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceDeleteClientEndpointMiddlewares ¶
func ServiceDeleteClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceDeleteClientOptions ¶
func ServiceDeleteClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceGetAllClientEndpointMiddlewares ¶
func ServiceGetAllClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceGetAllClientOptions ¶
func ServiceGetAllClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceGetClientEndpointMiddlewares ¶
func ServiceGetClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceGetClientOptions ¶
func ServiceGetClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceTestMethod2ClientEndpointMiddlewares ¶
func ServiceTestMethod2ClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceTestMethod2ClientOptions ¶
func ServiceTestMethod2ClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceTestMethodClientEndpointMiddlewares ¶
func ServiceTestMethodClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceTestMethodClientOptions ¶
func ServiceTestMethodClientOptions(opt ...jsonrpc.ClientOption) ClientOption
func ServiceTestMethodOptionalsClientEndpointMiddlewares ¶
func ServiceTestMethodOptionalsClientEndpointMiddlewares(opt ...endpoint.Middleware) ClientOption
func ServiceTestMethodOptionalsClientOptions ¶
func ServiceTestMethodOptionalsClientOptions(opt ...jsonrpc.ClientOption) ClientOption
type CreateRequest ¶
type DeleteRequest ¶
type DeleteRequest struct {
Id uint `json:"id"`
}
type DeleteResponse ¶
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 GetAllRequest ¶
type GetAllRequest struct {
Members Members `json:"members"`
}
type GetRequest ¶
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 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 uuid.UUID, 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
TestMethodOptionals(ctx context.Context, ns string, options ...OptionService) error
}
func NewClientJSONRPC ¶
func NewClientJSONRPC(tgt string, options ...ClientOption) (InterfaceB, error)
Deprecated
func NewClientJSONRPCService ¶
func NewClientJSONRPCService(tgt string, options ...ClientOption) (InterfaceB, error)
func NewInstrumentingServiceMiddleware ¶
func NewInstrumentingServiceMiddleware(s InterfaceB, opts ...InstrumentingOption) InterfaceB
func NewLoggingServiceMiddleware ¶
func NewLoggingServiceMiddleware(s InterfaceB, logger log.Logger) InterfaceB
type OptionService ¶
type OptionService struct {
Name string `json:"name"`
}
type ServerOption ¶
type ServerOption func(*serverOpts)
func GenericServerEndpointMiddlewares ¶
func GenericServerEndpointMiddlewares(v ...endpoint.Middleware) ServerOption
func GenericServerOptions ¶
func GenericServerOptions(v ...jsonrpc.ServerOption) ServerOption
func ServiceCreateServerEndpointMiddlewares ¶
func ServiceCreateServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceCreateServerOptions ¶
func ServiceCreateServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceDeleteServerEndpointMiddlewares ¶
func ServiceDeleteServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceDeleteServerOptions ¶
func ServiceDeleteServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceGetAllServerEndpointMiddlewares ¶
func ServiceGetAllServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceGetAllServerOptions ¶
func ServiceGetAllServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceGetServerEndpointMiddlewares ¶
func ServiceGetServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceGetServerOptions ¶
func ServiceGetServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceTestMethod2ServerEndpointMiddlewares ¶
func ServiceTestMethod2ServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceTestMethod2ServerOptions ¶
func ServiceTestMethod2ServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceTestMethodOptionalsServerEndpointMiddlewares ¶
func ServiceTestMethodOptionalsServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceTestMethodOptionalsServerOptions ¶
func ServiceTestMethodOptionalsServerOptions(opt ...jsonrpc.ServerOption) ServerOption
func ServiceTestMethodServerEndpointMiddlewares ¶
func ServiceTestMethodServerEndpointMiddlewares(opt ...endpoint.Middleware) ServerOption
func ServiceTestMethodServerOptions ¶
func ServiceTestMethodServerOptions(opt ...jsonrpc.ServerOption) ServerOption
type ServiceEndpointSet ¶
type ServiceEndpointSet struct {
CreateEndpoint endpoint.Endpoint
DeleteEndpoint endpoint.Endpoint
GetEndpoint endpoint.Endpoint
GetAllEndpoint endpoint.Endpoint
TestMethodEndpoint endpoint.Endpoint
TestMethod2Endpoint endpoint.Endpoint
TestMethodOptionalsEndpoint endpoint.Endpoint
}
func MakeServiceEndpointSet ¶
func MakeServiceEndpointSet(svc InterfaceB) ServiceEndpointSet
type ServiceInstrumentingMiddleware ¶
type ServiceInstrumentingMiddleware struct {
// contains filtered or unexported fields
}
func (*ServiceInstrumentingMiddleware) TestMethod ¶
func (*ServiceInstrumentingMiddleware) TestMethod2 ¶
func (*ServiceInstrumentingMiddleware) TestMethodOptionals ¶
func (s *ServiceInstrumentingMiddleware) TestMethodOptionals(ctx context.Context, ns string, options ...OptionService) error
type ServiceLoggingMiddleware ¶
type ServiceLoggingMiddleware struct {
// contains filtered or unexported fields
}
func (*ServiceLoggingMiddleware) TestMethod ¶
func (*ServiceLoggingMiddleware) TestMethod2 ¶
func (*ServiceLoggingMiddleware) TestMethodOptionals ¶
func (s *ServiceLoggingMiddleware) TestMethodOptionals(ctx context.Context, ns string, options ...OptionService) error
type TestMethod2Request ¶
type TestMethodOptionalsRequest ¶
type TestMethodOptionalsRequest struct {
Ns string `json:"ns"`
Options []OptionService `json:"options"`
}
type TestMethodRequest ¶
type TestMethodRequest struct {
Data map[string]interface{} `json:"data"`
Ss interface{} `json:"ss"`
}
type User ¶
type User struct {
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"`
Profile *Profile `json:"profile"`
Recurse *Recurse `json:"recurse"`
Kind Kind `json:"kind"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.