Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeError(_ context.Context, err error, w http.ResponseWriter)
- func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func MakeHandler(svc certs.Service, logger *slog.Logger, instanceID string) http.Handler
- type IssueFromCSRReq
- type Response
Constants ¶
View Source
const ( // ContentType represents JSON content type. ContentType = "application/json" OCSPType = "application/ocsp-response" )
Variables ¶
View Source
var ( // ErrEmptySerialNo indicates that the serial number is empty. ErrEmptySerialNo = errors.New("empty serial number provided") // ErrEmptyToken indicates that the token is empty. ErrEmptyToken = errors.New("empty token provided") // ErrEmptyList indicates that entity data is empty. ErrEmptyList = errors.New("empty list provided") // ErrMissingEntityID indicates missing entity ID. ErrMissingEntityID = errors.New("missing entity ID") // ErrUnsupportedContentType indicates unacceptable or lack of Content-Type. ErrUnsupportedContentType = errors.New("unsupported content type") // ErrValidation indicates that an error was returned by the API. ErrValidation = errors.New("something went wrong with the request") // ErrInvalidQueryParams indicates invalid query parameters. ErrInvalidQueryParams = errors.New("invalid query parameters") // ErrInvalidRequest indicates that the request is invalid. ErrInvalidRequest = errors.New("invalid request") // ErrMissingCN indicates missing common name. ErrMissingCN = errors.New("missing common name") // ErrMissingCSR indicates missing csr. ErrMissingCSR = errors.New("missing CSR") // ErrMissingPrivKey indicates missing csr. ErrMissingPrivKey = errors.New("missing private key") )
Functions ¶
func EncodeError ¶
func EncodeError(_ context.Context, err error, w http.ResponseWriter)
EncodeError encodes an error response.
func EncodeResponse ¶
func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
EncodeResponse encodes successful response.
Types ¶
type IssueFromCSRReq ¶
type IssueFromCSRReq struct { CSR string `json:"csr"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.