Documentation ¶
Index ¶
- type Broker
- type Cache
- type Closer
- type EchoRestHandler
- type GRPCHandler
- type GRPCMiddleware
- type GraphQLHandler
- type GraphQLMiddleware
- type HTTPMiddleware
- type Middleware
- type MongoDatabase
- type Publisher
- type RSAKey
- type RedisPool
- type SQLDatabase
- type TokenValidator
- type Tracer
- type Validator
- type WorkerHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface { GetKafkaClient() sarama.Client Publisher(types.Worker) Publisher Health() map[string]error Closer }
Broker abstraction
type Cache ¶
type Cache interface { Get(ctx context.Context, key string) ([]byte, error) GetKeys(ctx context.Context, pattern string) ([]string, error) Set(ctx context.Context, key string, value interface{}, expire time.Duration) error Exists(ctx context.Context, key string) (bool, error) Delete(ctx context.Context, key string) error }
Cache abstract interface
type EchoRestHandler ¶
EchoRestHandler delivery factory for echo handler
type GRPCHandler ¶
type GRPCHandler interface {
Register(server *grpc.Server, middlewareGroup *types.MiddlewareGroup)
}
GRPCHandler delivery factory for grpc handler
type GRPCMiddleware ¶
type GRPCMiddleware interface { GRPCBasicAuth(ctx context.Context) context.Context GRPCBearerAuth(ctx context.Context) context.Context }
GRPCMiddleware interface, common middleware for grpc handler
type GraphQLHandler ¶
type GraphQLHandler interface { Query() interface{} Mutation() interface{} Subscription() interface{} RegisterMiddleware(group *types.MiddlewareGroup) }
GraphQLHandler delivery factory for graphql resolver handler
type GraphQLMiddleware ¶
type GraphQLMiddleware interface { GraphQLBasicAuth(ctx context.Context) context.Context GraphQLBearerAuth(ctx context.Context) context.Context }
GraphQLMiddleware interface, common middleware for graphql handler, as directive in graphql schema
type HTTPMiddleware ¶
type HTTPMiddleware interface { HTTPBasicAuth(showAlert bool) echo.MiddlewareFunc HTTPBearerAuth() echo.MiddlewareFunc HTTPMultipleAuth() echo.MiddlewareFunc }
HTTPMiddleware interface, common middleware for http handler
type Middleware ¶
type Middleware interface { Basic(ctx context.Context, authKey string) error Bearer(ctx context.Context, token string) (*candishared.TokenClaim, error) HTTPMiddleware GRPCMiddleware GraphQLMiddleware }
Middleware abstraction
type MongoDatabase ¶
type MongoDatabase interface { ReadDB() *mongo.Database WriteDB() *mongo.Database Health() map[string]error Closer }
MongoDatabase abstraction
type Publisher ¶
type Publisher interface {
PublishMessage(ctx context.Context, topic, key string, message interface{}) (err error)
}
Publisher abstract interface
type RSAKey ¶
type RSAKey interface { PrivateKey() *rsa.PrivateKey PublicKey() *rsa.PublicKey }
RSAKey abstraction
type RedisPool ¶
type RedisPool interface { ReadPool() *redis.Pool WritePool() *redis.Pool Health() map[string]error Cache() Cache Closer }
RedisPool abstraction
type SQLDatabase ¶
SQLDatabase abstraction
type TokenValidator ¶
type TokenValidator interface {
ValidateToken(ctx context.Context, token string) (*candishared.TokenClaim, error)
}
TokenValidator abstract interface
type Tracer ¶
type Tracer interface { Context() context.Context Tags() map[string]interface{} SetTag(key string, value interface{}) InjectHTTPHeader(req *http.Request) InjectGRPCMetadata(md metadata.MD) SetError(err error) Finish(additionalTags ...map[string]interface{}) }
Tracer for trace
type Validator ¶
type Validator interface { ValidateDocument(reference string, document []byte) error ValidateStruct(data interface{}) error }
Validator abstract interface
type WorkerHandler ¶
type WorkerHandler interface {
MountHandlers(group *types.WorkerHandlerGroup)
}
WorkerHandler delivery factory for all worker handler