Documentation ¶
Index ¶
- func DecodeDecryptRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeEncryptRequest(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func MakeDecryptEndpoint(svc EncryptService) endpoint.Endpoint
- func MakeEncryptEndpoint(svc EncryptService) endpoint.Endpoint
- type DecryptRequest
- type DecryptResponse
- type EncryptRequest
- type EncryptResponse
- type EncryptService
- type EncryptServiceInstance
- type InstrumentingMiddleware
- type LoggingMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeDecryptRequest ¶
DecodeDecryptRequest fills struct from JSON details of request
func DecodeEncryptRequest ¶
DecodeEncryptRequest fills struct from JSON details of request
func EncodeResponse ¶
func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
EncodeResponse is common for both the reponses from encrypt and decrypt services
func MakeDecryptEndpoint ¶
func MakeDecryptEndpoint(svc EncryptService) endpoint.Endpoint
MakeDecryptEndpoint forms endpoint for request/response of decrypt function
func MakeEncryptEndpoint ¶
func MakeEncryptEndpoint(svc EncryptService) endpoint.Endpoint
MakeEncryptEndpoint forms endpoint for request/response of encrypt function
Types ¶
type DecryptRequest ¶
DecryptRequest strctures request coming from client
type DecryptResponse ¶
DecryptResponse strctures response going to the client
type EncryptRequest ¶
EncryptRequest strctures request coming from client
type EncryptResponse ¶
EncryptResponse strctures response going to the client
type EncryptService ¶
type EncryptService interface { Encrypt(context.Context, string, string) (string, error) Decrypt(context.Context, string, string) (string, error) }
EncryptService is a blueprint for our service
type EncryptServiceInstance ¶
type EncryptServiceInstance struct{}
EncryptServiceInstance is the implementation of interface for micro service
type InstrumentingMiddleware ¶
type InstrumentingMiddleware struct { RequestCount metrics.Counter RequestLatency metrics.Histogram Next EncryptService }
InstrumentingMiddleware is a struct representing middleware
type LoggingMiddleware ¶
type LoggingMiddleware struct { Logger log.Logger Next EncryptService }
LoggingMiddleware wraps the logs for incoming requests