Documentation ¶
Index ¶
- Variables
- func HTTPToContext(logger log.Logger) httptransport.RequestFunc
- func MakeDeleteDeviceEndpoint(s Service) endpoint.Endpoint
- func MakeDeleteRevokeEndpoint(s Service) endpoint.Endpoint
- func MakeGetDeviceByIdEndpoint(s Service) endpoint.Endpoint
- func MakeGetDeviceCertEndpoint(s Service) endpoint.Endpoint
- func MakeGetDeviceCertHistoryEndpoint(s Service) endpoint.Endpoint
- func MakeGetDeviceLogsEndpoint(s Service) endpoint.Endpoint
- func MakeGetDevicesByDMSEndpoint(s Service) endpoint.Endpoint
- func MakeGetDevicesEndpoint(s Service) endpoint.Endpoint
- func MakeGetDmsCertHistoryThirtyDaysEndpoint(s Service) endpoint.Endpoint
- func MakeGetDmsLastIssueCertEndpoint(s Service) endpoint.Endpoint
- func MakeHTTPHandler(s Service, logger log.Logger, otTracer stdopentracing.Tracer) http.Handler
- func MakeHealthEndpoint(s Service) endpoint.Endpoint
- func MakePostDeviceEndpoint(s Service) endpoint.Endpoint
- func NewParserm(mtlsCa x509.Certificate) endpoint.Middleware
- type Endpoints
- type Middleware
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Client errors ErrInvalidDeviceRequest = errors.New("unable to parse device, is invalid") //400 ErrInvalidDMSId = errors.New("unable to parse DMS ID, is invalid") //400 ErrInvalidDeviceId = errors.New("unable to parse Device ID, is invalid") //400 ErrIncorrectType = errors.New("unsupported media type") //415 ErrEmptyBody = errors.New("empty body") //Server errors ErrInvalidOperation = errors.New("invalid operation") ErrActiveCert = errors.New("can't isuee certificate. The device has a valid cert") ErrResponseEncode = errors.New("error encoding response") )
Functions ¶
func HTTPToContext ¶
func HTTPToContext(logger log.Logger) httptransport.RequestFunc
func MakeGetDevicesEndpoint ¶
func MakeHTTPHandler ¶
func MakeHealthEndpoint ¶
func MakePostDeviceEndpoint ¶
func NewParserm ¶
func NewParserm(mtlsCa x509.Certificate) endpoint.Middleware
Types ¶
type Endpoints ¶
type Endpoints struct { HealthEndpoint endpoint.Endpoint PostDeviceEndpoint endpoint.Endpoint GetDevices endpoint.Endpoint GetDeviceById endpoint.Endpoint GetDevicesByDMS endpoint.Endpoint DeleteDevice endpoint.Endpoint DeleteRevoke endpoint.Endpoint GetDeviceLogs endpoint.Endpoint GetDeviceCert endpoint.Endpoint GetDeviceCertHistory endpoint.Endpoint GetDmsCertHistoryThirtyDays endpoint.Endpoint GetDmsLastIssueCert endpoint.Endpoint }
func MakeServerEndpoints ¶
func MakeServerEndpoints(s Service, otTracer stdopentracing.Tracer) Endpoints
type Middleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
func NewInstrumentingMiddleware ¶
func NewInstrumentingMiddleware(counter metrics.Counter, latency metrics.Histogram) Middleware
type Service ¶
type Service interface { Health(ctx context.Context) bool PostDevice(ctx context.Context, device devicesModel.Device) (devicesModel.Device, error) GetDevices(ctx context.Context) (devicesModel.Devices, error) GetDeviceById(ctx context.Context, deviceId string) (devicesModel.Device, error) GetDevicesByDMS(ctx context.Context, dmsId string) (devicesModel.Devices, error) DeleteDevice(ctx context.Context, id string) error RevokeDeviceCert(ctx context.Context, id string, revocationReason string) error GetDeviceLogs(ctx context.Context, id string) (devicesModel.DeviceLogs, error) GetDeviceCert(ctx context.Context, id string) (devicesModel.DeviceCert, error) GetDeviceCertHistory(ctx context.Context, id string) (devicesModel.DeviceCertsHistory, error) GetDmsCertHistoryThirtyDays(ctx context.Context) (devicesModel.DMSCertsHistory, error) GetDmsLastIssuedCert(ctx context.Context) (devicesModel.DMSsLastIssued, error) }
func NewDevicesService ¶
func NewDevicesService(devicesDb devicesStore.DB, lamassuCa *lamassucaclient.LamassuCaClient, logger log.Logger) Service
Click to show internal directories.
Click to hide internal directories.