api

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHTTPHandler

func MakeHTTPHandler(s Service, logger log.Logger, auth auth.Auth, otTracer stdopentracing.Tracer) http.Handler

func MakeHealthEndpoint

func MakeHealthEndpoint(s Service) endpoint.Endpoint

func MakePostGetCRTEndpoint

func MakePostGetCRTEndpoint(s Service) endpoint.Endpoint

func MakePostSetConfigEndpoint

func MakePostSetConfigEndpoint(s Service) endpoint.Endpoint

Types

type Endpoints

type Endpoints struct {
	HealthEndpoint        endpoint.Endpoint
	PostSetConfigEndpoint endpoint.Endpoint
	PostGetCRTEndpoint    endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service, otTracer stdopentracing.Tracer) Endpoints

type Middleware

type Middleware func(Service) Service

func LoggingMidleware

func LoggingMidleware(logger log.Logger) Middleware

func NewInstumentingMiddleware

func NewInstumentingMiddleware(counter metrics.Counter, latency metrics.Histogram) Middleware

type Service

type Service interface {
	Health(ctx context.Context) bool
	PostSetConfig(ctx context.Context, authCRT string, CA string) error
	PostGetCRT(ctx context.Context, keyAlg string, keySize int, c string, st string, l string, o string, ou string, cn string, email string) (data []byte, err error)
}

func NewDeviceService

func NewDeviceService(authKeyFile string, client client.Client) Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL