Documentation ¶
Index ¶
- type AcceptanceResponse
- func (s *AcceptanceResponse) Decode(d *jx.Decoder) error
- func (s *AcceptanceResponse) Encode(e *jx.Encoder)
- func (s *AcceptanceResponse) GetMessage() string
- func (s *AcceptanceResponse) MarshalJSON() ([]byte, error)
- func (s *AcceptanceResponse) SetMessage(val string)
- func (s *AcceptanceResponse) UnmarshalJSON(data []byte) error
- type Access
- type DeleteMessageParams
- type ErrorHandler
- type ErrorResponse
- type ErrorResponseStatusCode
- type GetMessageParams
- type GetUserMessagesParams
- type Handler
- type MessageRequest
- func (s *MessageRequest) Decode(d *jx.Decoder) error
- func (s *MessageRequest) Encode(e *jx.Encoder)
- func (s *MessageRequest) GetMessage() string
- func (s *MessageRequest) MarshalJSON() ([]byte, error)
- func (s *MessageRequest) SetMessage(val string)
- func (s *MessageRequest) UnmarshalJSON(data []byte) error
- func (s *MessageRequest) Validate() error
- type MessageResponse
- func (s *MessageResponse) Decode(d *jx.Decoder) error
- func (s *MessageResponse) Encode(e *jx.Encoder)
- func (s *MessageResponse) GetID() int64
- func (s *MessageResponse) GetMessage() string
- func (s *MessageResponse) GetVersion() int32
- func (s *MessageResponse) MarshalJSON() ([]byte, error)
- func (s *MessageResponse) SetID(val int64)
- func (s *MessageResponse) SetMessage(val string)
- func (s *MessageResponse) SetVersion(val int32)
- func (s *MessageResponse) UnmarshalJSON(data []byte) error
- type MessagesMetadataResponse
- func (s *MessagesMetadataResponse) Decode(d *jx.Decoder) error
- func (s *MessagesMetadataResponse) Encode(e *jx.Encoder)
- func (s *MessagesMetadataResponse) GetCurrentPage() int32
- func (s *MessagesMetadataResponse) GetFirstPage() int32
- func (s *MessagesMetadataResponse) GetLastPage() int32
- func (s *MessagesMetadataResponse) GetPageSize() int32
- func (s *MessagesMetadataResponse) GetTotalRecords() int64
- func (s *MessagesMetadataResponse) MarshalJSON() ([]byte, error)
- func (s *MessagesMetadataResponse) SetCurrentPage(val int32)
- func (s *MessagesMetadataResponse) SetFirstPage(val int32)
- func (s *MessagesMetadataResponse) SetLastPage(val int32)
- func (s *MessagesMetadataResponse) SetPageSize(val int32)
- func (s *MessagesMetadataResponse) SetTotalRecords(val int64)
- func (s *MessagesMetadataResponse) UnmarshalJSON(data []byte) error
- type MessagesResponse
- func (s *MessagesResponse) Decode(d *jx.Decoder) error
- func (s *MessagesResponse) Encode(e *jx.Encoder)
- func (s *MessagesResponse) GetMessages() []MessageResponse
- func (s *MessagesResponse) GetMetadata() MessagesMetadataResponse
- func (s *MessagesResponse) MarshalJSON() ([]byte, error)
- func (s *MessagesResponse) SetMessages(val []MessageResponse)
- func (s *MessagesResponse) SetMetadata(val MessagesMetadataResponse)
- func (s *MessagesResponse) UnmarshalJSON(data []byte) error
- func (s *MessagesResponse) Validate() error
- type Middleware
- type OptInt32
- type OptString
- type Option
- type Refresh
- type Route
- type SecurityHandler
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type TokenRequest
- func (s *TokenRequest) Decode(d *jx.Decoder) error
- func (s *TokenRequest) Encode(e *jx.Encoder)
- func (s *TokenRequest) GetToken() string
- func (s *TokenRequest) MarshalJSON() ([]byte, error)
- func (s *TokenRequest) SetToken(val string)
- func (s *TokenRequest) UnmarshalJSON(data []byte) error
- func (s *TokenRequest) Validate() error
- type TokenResponse
- func (s *TokenResponse) Decode(d *jx.Decoder) error
- func (s *TokenResponse) Encode(e *jx.Encoder)
- func (s *TokenResponse) GetExpiry() time.Time
- func (s *TokenResponse) GetScope() string
- func (s *TokenResponse) GetToken() string
- func (s *TokenResponse) MarshalJSON() ([]byte, error)
- func (s *TokenResponse) SetExpiry(val time.Time)
- func (s *TokenResponse) SetScope(val string)
- func (s *TokenResponse) SetToken(val string)
- func (s *TokenResponse) UnmarshalJSON(data []byte) error
- type TokenResponseHeaders
- type UnimplementedHandler
- func (UnimplementedHandler) ActivateUser(ctx context.Context, req *TokenRequest) (r *UserResponse, _ error)
- func (UnimplementedHandler) DeleteMessage(ctx context.Context, params DeleteMessageParams) (r *AcceptanceResponse, _ error)
- func (UnimplementedHandler) GetMessage(ctx context.Context, params GetMessageParams) (r *MessageResponse, _ error)
- func (UnimplementedHandler) GetUserMessages(ctx context.Context, params GetUserMessagesParams) (r *MessagesResponse, _ error)
- func (UnimplementedHandler) NewAccessToken(ctx context.Context) (r *TokenResponseHeaders, _ error)
- func (UnimplementedHandler) NewActivationToken(ctx context.Context, req *UserEmailRequest) (r *TokenResponse, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorResponseStatusCode)
- func (UnimplementedHandler) NewMessage(ctx context.Context, req *MessageRequest) (r *MessageResponse, _ error)
- func (UnimplementedHandler) NewPasswordResetToken(ctx context.Context, req *UserEmailRequest) (r *TokenResponse, _ error)
- func (UnimplementedHandler) NewRefreshToken(ctx context.Context, req *UserLoginRequest) (r *TokenResponseHeaders, _ error)
- func (UnimplementedHandler) NewUser(ctx context.Context, req *UserRequest) (r *UserResponse, _ error)
- func (UnimplementedHandler) UpdateMessage(ctx context.Context, req *MessageRequest, params UpdateMessageParams) (r *MessageResponse, _ error)
- func (UnimplementedHandler) UpdateUserPassword(ctx context.Context, req *UpdateUserPasswordRequest) (r *AcceptanceResponse, _ error)
- type UpdateMessageParams
- type UpdateUserPasswordRequest
- func (s *UpdateUserPasswordRequest) Decode(d *jx.Decoder) error
- func (s *UpdateUserPasswordRequest) Encode(e *jx.Encoder)
- func (s *UpdateUserPasswordRequest) GetPassword() string
- func (s *UpdateUserPasswordRequest) GetToken() string
- func (s *UpdateUserPasswordRequest) MarshalJSON() ([]byte, error)
- func (s *UpdateUserPasswordRequest) SetPassword(val string)
- func (s *UpdateUserPasswordRequest) SetToken(val string)
- func (s *UpdateUserPasswordRequest) UnmarshalJSON(data []byte) error
- func (s *UpdateUserPasswordRequest) Validate() error
- type UserEmailRequest
- func (s *UserEmailRequest) Decode(d *jx.Decoder) error
- func (s *UserEmailRequest) Encode(e *jx.Encoder)
- func (s *UserEmailRequest) GetEmail() string
- func (s *UserEmailRequest) MarshalJSON() ([]byte, error)
- func (s *UserEmailRequest) SetEmail(val string)
- func (s *UserEmailRequest) UnmarshalJSON(data []byte) error
- func (s *UserEmailRequest) Validate() error
- type UserLoginRequest
- func (s *UserLoginRequest) Decode(d *jx.Decoder) error
- func (s *UserLoginRequest) Encode(e *jx.Encoder)
- func (s *UserLoginRequest) GetEmail() string
- func (s *UserLoginRequest) GetPassword() string
- func (s *UserLoginRequest) MarshalJSON() ([]byte, error)
- func (s *UserLoginRequest) SetEmail(val string)
- func (s *UserLoginRequest) SetPassword(val string)
- func (s *UserLoginRequest) UnmarshalJSON(data []byte) error
- func (s *UserLoginRequest) Validate() error
- type UserRequest
- func (s *UserRequest) Decode(d *jx.Decoder) error
- func (s *UserRequest) Encode(e *jx.Encoder)
- func (s *UserRequest) GetEmail() string
- func (s *UserRequest) GetName() string
- func (s *UserRequest) GetPassword() string
- func (s *UserRequest) MarshalJSON() ([]byte, error)
- func (s *UserRequest) SetEmail(val string)
- func (s *UserRequest) SetName(val string)
- func (s *UserRequest) SetPassword(val string)
- func (s *UserRequest) UnmarshalJSON(data []byte) error
- func (s *UserRequest) Validate() error
- type UserResponse
- func (s *UserResponse) Decode(d *jx.Decoder) error
- func (s *UserResponse) Encode(e *jx.Encoder)
- func (s *UserResponse) GetEmail() string
- func (s *UserResponse) GetName() string
- func (s *UserResponse) GetVersion() int32
- func (s *UserResponse) MarshalJSON() ([]byte, error)
- func (s *UserResponse) SetEmail(val string)
- func (s *UserResponse) SetName(val string)
- func (s *UserResponse) SetVersion(val int32)
- func (s *UserResponse) UnmarshalJSON(data []byte) error
- func (s *UserResponse) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptanceResponse ¶
type AcceptanceResponse struct {
Message string `json:"message"`
}
Contains a message. Ref: #/components/schemas/AcceptanceResponse
func (*AcceptanceResponse) Decode ¶
func (s *AcceptanceResponse) Decode(d *jx.Decoder) error
Decode decodes AcceptanceResponse from json.
func (*AcceptanceResponse) Encode ¶
func (s *AcceptanceResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AcceptanceResponse) GetMessage ¶
func (s *AcceptanceResponse) GetMessage() string
GetMessage returns the value of Message.
func (*AcceptanceResponse) MarshalJSON ¶
func (s *AcceptanceResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AcceptanceResponse) SetMessage ¶
func (s *AcceptanceResponse) SetMessage(val string)
SetMessage sets the value of Message.
func (*AcceptanceResponse) UnmarshalJSON ¶
func (s *AcceptanceResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type DeleteMessageParams ¶
type DeleteMessageParams struct {
ID int64
}
DeleteMessageParams is parameters of DeleteMessage operation.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
Contains an error. Ref: #/components/schemas/ErrorResponse
func (*ErrorResponse) Decode ¶
func (s *ErrorResponse) Decode(d *jx.Decoder) error
Decode decodes ErrorResponse from json.
func (*ErrorResponse) Encode ¶
func (s *ErrorResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ErrorResponse) GetError ¶
func (s *ErrorResponse) GetError() string
GetError returns the value of Error.
func (*ErrorResponse) MarshalJSON ¶
func (s *ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ErrorResponse) SetError ¶
func (s *ErrorResponse) SetError(val string)
SetError sets the value of Error.
func (*ErrorResponse) UnmarshalJSON ¶
func (s *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorResponseStatusCode ¶
type ErrorResponseStatusCode struct { StatusCode int Response ErrorResponse }
ErrorResponseStatusCode wraps ErrorResponse with StatusCode.
func (*ErrorResponseStatusCode) Error ¶
func (s *ErrorResponseStatusCode) Error() string
func (*ErrorResponseStatusCode) GetResponse ¶
func (s *ErrorResponseStatusCode) GetResponse() ErrorResponse
GetResponse returns the value of Response.
func (*ErrorResponseStatusCode) GetStatusCode ¶
func (s *ErrorResponseStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*ErrorResponseStatusCode) SetResponse ¶
func (s *ErrorResponseStatusCode) SetResponse(val ErrorResponse)
SetResponse sets the value of Response.
func (*ErrorResponseStatusCode) SetStatusCode ¶
func (s *ErrorResponseStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type GetMessageParams ¶
type GetMessageParams struct {
ID int64
}
GetMessageParams is parameters of GetMessage operation.
type GetUserMessagesParams ¶
GetUserMessagesParams is parameters of GetUserMessages operation.
type Handler ¶
type Handler interface { // ActivateUser implements ActivateUser operation. // // PATCH /v1/users/activate ActivateUser(ctx context.Context, req *TokenRequest) (*UserResponse, error) // DeleteMessage implements DeleteMessage operation. // // DELETE /v1/messages/{id} DeleteMessage(ctx context.Context, params DeleteMessageParams) (*AcceptanceResponse, error) // GetMessage implements GetMessage operation. // // GET /v1/messages/{id} GetMessage(ctx context.Context, params GetMessageParams) (*MessageResponse, error) // GetUserMessages implements GetUserMessages operation. // // GET /v1/messages GetUserMessages(ctx context.Context, params GetUserMessagesParams) (*MessagesResponse, error) // NewAccessToken implements NewAccessToken operation. // // POST /v1/tokens/access NewAccessToken(ctx context.Context) (*TokenResponseHeaders, error) // NewActivationToken implements NewActivationToken operation. // // POST /v1/tokens/activation NewActivationToken(ctx context.Context, req *UserEmailRequest) (*TokenResponse, error) // NewMessage implements NewMessage operation. // // POST /v1/messages NewMessage(ctx context.Context, req *MessageRequest) (*MessageResponse, error) // NewPasswordResetToken implements NewPasswordResetToken operation. // // POST /v1/tokens/password-reset NewPasswordResetToken(ctx context.Context, req *UserEmailRequest) (*TokenResponse, error) // NewRefreshToken implements NewRefreshToken operation. // // POST /v1/tokens/refresh NewRefreshToken(ctx context.Context, req *UserLoginRequest) (*TokenResponseHeaders, error) // NewUser implements NewUser operation. // // POST /v1/users/register NewUser(ctx context.Context, req *UserRequest) (*UserResponse, error) // UpdateMessage implements UpdateMessage operation. // // PUT /v1/messages/{id} UpdateMessage(ctx context.Context, req *MessageRequest, params UpdateMessageParams) (*MessageResponse, error) // UpdateUserPassword implements UpdateUserPassword operation. // // PATCH /v1/users/update-password UpdateUserPassword(ctx context.Context, req *UpdateUserPasswordRequest) (*AcceptanceResponse, error) // NewError creates *ErrorResponseStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorResponseStatusCode }
Handler handles operations described by OpenAPI v3 specification.
type MessageRequest ¶
type MessageRequest struct {
Message string `json:"message"`
}
Contains a message as well as optional properties. Ref: #/components/schemas/MessageRequest
func (*MessageRequest) Decode ¶
func (s *MessageRequest) Decode(d *jx.Decoder) error
Decode decodes MessageRequest from json.
func (*MessageRequest) Encode ¶
func (s *MessageRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*MessageRequest) GetMessage ¶
func (s *MessageRequest) GetMessage() string
GetMessage returns the value of Message.
func (*MessageRequest) MarshalJSON ¶
func (s *MessageRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MessageRequest) SetMessage ¶
func (s *MessageRequest) SetMessage(val string)
SetMessage sets the value of Message.
func (*MessageRequest) UnmarshalJSON ¶
func (s *MessageRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*MessageRequest) Validate ¶
func (s *MessageRequest) Validate() error
type MessageResponse ¶
type MessageResponse struct { ID int64 `json:"id"` Message string `json:"message"` Version int32 `json:"version"` }
Contains a message as well as optional properties. Ref: #/components/schemas/MessageResponse
func (*MessageResponse) Decode ¶
func (s *MessageResponse) Decode(d *jx.Decoder) error
Decode decodes MessageResponse from json.
func (*MessageResponse) Encode ¶
func (s *MessageResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*MessageResponse) GetID ¶
func (s *MessageResponse) GetID() int64
GetID returns the value of ID.
func (*MessageResponse) GetMessage ¶
func (s *MessageResponse) GetMessage() string
GetMessage returns the value of Message.
func (*MessageResponse) GetVersion ¶
func (s *MessageResponse) GetVersion() int32
GetVersion returns the value of Version.
func (*MessageResponse) MarshalJSON ¶
func (s *MessageResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MessageResponse) SetID ¶
func (s *MessageResponse) SetID(val int64)
SetID sets the value of ID.
func (*MessageResponse) SetMessage ¶
func (s *MessageResponse) SetMessage(val string)
SetMessage sets the value of Message.
func (*MessageResponse) SetVersion ¶
func (s *MessageResponse) SetVersion(val int32)
SetVersion sets the value of Version.
func (*MessageResponse) UnmarshalJSON ¶
func (s *MessageResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type MessagesMetadataResponse ¶
type MessagesMetadataResponse struct { CurrentPage int32 `json:"current_page"` FirstPage int32 `json:"first_page"` LastPage int32 `json:"last_page"` PageSize int32 `json:"page_size"` TotalRecords int64 `json:"total_records"` }
Contains metadata. Ref: #/components/schemas/MessagesMetadataResponse
func (*MessagesMetadataResponse) Decode ¶
func (s *MessagesMetadataResponse) Decode(d *jx.Decoder) error
Decode decodes MessagesMetadataResponse from json.
func (*MessagesMetadataResponse) Encode ¶
func (s *MessagesMetadataResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*MessagesMetadataResponse) GetCurrentPage ¶
func (s *MessagesMetadataResponse) GetCurrentPage() int32
GetCurrentPage returns the value of CurrentPage.
func (*MessagesMetadataResponse) GetFirstPage ¶
func (s *MessagesMetadataResponse) GetFirstPage() int32
GetFirstPage returns the value of FirstPage.
func (*MessagesMetadataResponse) GetLastPage ¶
func (s *MessagesMetadataResponse) GetLastPage() int32
GetLastPage returns the value of LastPage.
func (*MessagesMetadataResponse) GetPageSize ¶
func (s *MessagesMetadataResponse) GetPageSize() int32
GetPageSize returns the value of PageSize.
func (*MessagesMetadataResponse) GetTotalRecords ¶
func (s *MessagesMetadataResponse) GetTotalRecords() int64
GetTotalRecords returns the value of TotalRecords.
func (*MessagesMetadataResponse) MarshalJSON ¶
func (s *MessagesMetadataResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MessagesMetadataResponse) SetCurrentPage ¶
func (s *MessagesMetadataResponse) SetCurrentPage(val int32)
SetCurrentPage sets the value of CurrentPage.
func (*MessagesMetadataResponse) SetFirstPage ¶
func (s *MessagesMetadataResponse) SetFirstPage(val int32)
SetFirstPage sets the value of FirstPage.
func (*MessagesMetadataResponse) SetLastPage ¶
func (s *MessagesMetadataResponse) SetLastPage(val int32)
SetLastPage sets the value of LastPage.
func (*MessagesMetadataResponse) SetPageSize ¶
func (s *MessagesMetadataResponse) SetPageSize(val int32)
SetPageSize sets the value of PageSize.
func (*MessagesMetadataResponse) SetTotalRecords ¶
func (s *MessagesMetadataResponse) SetTotalRecords(val int64)
SetTotalRecords sets the value of TotalRecords.
func (*MessagesMetadataResponse) UnmarshalJSON ¶
func (s *MessagesMetadataResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type MessagesResponse ¶
type MessagesResponse struct { Messages []MessageResponse `json:"messages"` Metadata MessagesMetadataResponse `json:"metadata"` }
Contains messages and metadata objects. Ref: #/components/schemas/MessagesResponse
func (*MessagesResponse) Decode ¶
func (s *MessagesResponse) Decode(d *jx.Decoder) error
Decode decodes MessagesResponse from json.
func (*MessagesResponse) Encode ¶
func (s *MessagesResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*MessagesResponse) GetMessages ¶
func (s *MessagesResponse) GetMessages() []MessageResponse
GetMessages returns the value of Messages.
func (*MessagesResponse) GetMetadata ¶
func (s *MessagesResponse) GetMetadata() MessagesMetadataResponse
GetMetadata returns the value of Metadata.
func (*MessagesResponse) MarshalJSON ¶
func (s *MessagesResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MessagesResponse) SetMessages ¶
func (s *MessagesResponse) SetMessages(val []MessageResponse)
SetMessages sets the value of Messages.
func (*MessagesResponse) SetMetadata ¶
func (s *MessagesResponse) SetMetadata(val MessagesMetadataResponse)
SetMetadata sets the value of Metadata.
func (*MessagesResponse) UnmarshalJSON ¶
func (s *MessagesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*MessagesResponse) Validate ¶
func (s *MessagesResponse) Validate() error
type OptInt32 ¶
OptInt32 is optional int32.
func NewOptInt32 ¶
NewOptInt32 returns new OptInt32 with value set to v.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
type Option ¶
type Option interface { ServerOption }
Option is config option.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the metric.NewNoopMeterProvider is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type Refresh ¶
type Refresh struct {
APIKey string
}
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface { // HandleAccess handles Access security. HandleAccess(ctx context.Context, operationName string, t Access) (context.Context, error) // HandleRefresh handles Refresh security. HandleRefresh(ctx context.Context, operationName string, t Refresh) (context.Context, error) }
SecurityHandler is handler for security parameters.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type TokenRequest ¶
type TokenRequest struct {
Token string `json:"token"`
}
Contains a plaintext token as well as optional properties. Ref: #/components/schemas/TokenRequest
func (*TokenRequest) Decode ¶
func (s *TokenRequest) Decode(d *jx.Decoder) error
Decode decodes TokenRequest from json.
func (*TokenRequest) Encode ¶
func (s *TokenRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TokenRequest) GetToken ¶
func (s *TokenRequest) GetToken() string
GetToken returns the value of Token.
func (*TokenRequest) MarshalJSON ¶
func (s *TokenRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TokenRequest) SetToken ¶
func (s *TokenRequest) SetToken(val string)
SetToken sets the value of Token.
func (*TokenRequest) UnmarshalJSON ¶
func (s *TokenRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TokenRequest) Validate ¶
func (s *TokenRequest) Validate() error
type TokenResponse ¶
type TokenResponse struct { Scope string `json:"scope"` Expiry time.Time `json:"expiry"` Token string `json:"token"` }
Contains a plaintext token as well as optional properties. Ref: #/components/schemas/TokenResponse
func (*TokenResponse) Decode ¶
func (s *TokenResponse) Decode(d *jx.Decoder) error
Decode decodes TokenResponse from json.
func (*TokenResponse) Encode ¶
func (s *TokenResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TokenResponse) GetExpiry ¶
func (s *TokenResponse) GetExpiry() time.Time
GetExpiry returns the value of Expiry.
func (*TokenResponse) GetScope ¶
func (s *TokenResponse) GetScope() string
GetScope returns the value of Scope.
func (*TokenResponse) GetToken ¶
func (s *TokenResponse) GetToken() string
GetToken returns the value of Token.
func (*TokenResponse) MarshalJSON ¶
func (s *TokenResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TokenResponse) SetExpiry ¶
func (s *TokenResponse) SetExpiry(val time.Time)
SetExpiry sets the value of Expiry.
func (*TokenResponse) SetScope ¶
func (s *TokenResponse) SetScope(val string)
SetScope sets the value of Scope.
func (*TokenResponse) SetToken ¶
func (s *TokenResponse) SetToken(val string)
SetToken sets the value of Token.
func (*TokenResponse) UnmarshalJSON ¶
func (s *TokenResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type TokenResponseHeaders ¶
type TokenResponseHeaders struct { SetCookie OptString Response TokenResponse }
TokenResponseHeaders wraps TokenResponse with response headers.
func (*TokenResponseHeaders) GetResponse ¶
func (s *TokenResponseHeaders) GetResponse() TokenResponse
GetResponse returns the value of Response.
func (*TokenResponseHeaders) GetSetCookie ¶
func (s *TokenResponseHeaders) GetSetCookie() OptString
GetSetCookie returns the value of SetCookie.
func (*TokenResponseHeaders) SetResponse ¶
func (s *TokenResponseHeaders) SetResponse(val TokenResponse)
SetResponse sets the value of Response.
func (*TokenResponseHeaders) SetSetCookie ¶
func (s *TokenResponseHeaders) SetSetCookie(val OptString)
SetSetCookie sets the value of SetCookie.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) ActivateUser ¶
func (UnimplementedHandler) ActivateUser(ctx context.Context, req *TokenRequest) (r *UserResponse, _ error)
ActivateUser implements ActivateUser operation.
PATCH /v1/users/activate
func (UnimplementedHandler) DeleteMessage ¶
func (UnimplementedHandler) DeleteMessage(ctx context.Context, params DeleteMessageParams) (r *AcceptanceResponse, _ error)
DeleteMessage implements DeleteMessage operation.
DELETE /v1/messages/{id}
func (UnimplementedHandler) GetMessage ¶
func (UnimplementedHandler) GetMessage(ctx context.Context, params GetMessageParams) (r *MessageResponse, _ error)
GetMessage implements GetMessage operation.
GET /v1/messages/{id}
func (UnimplementedHandler) GetUserMessages ¶
func (UnimplementedHandler) GetUserMessages(ctx context.Context, params GetUserMessagesParams) (r *MessagesResponse, _ error)
GetUserMessages implements GetUserMessages operation.
GET /v1/messages
func (UnimplementedHandler) NewAccessToken ¶
func (UnimplementedHandler) NewAccessToken(ctx context.Context) (r *TokenResponseHeaders, _ error)
NewAccessToken implements NewAccessToken operation.
POST /v1/tokens/access
func (UnimplementedHandler) NewActivationToken ¶
func (UnimplementedHandler) NewActivationToken(ctx context.Context, req *UserEmailRequest) (r *TokenResponse, _ error)
NewActivationToken implements NewActivationToken operation.
POST /v1/tokens/activation
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorResponseStatusCode)
NewError creates *ErrorResponseStatusCode from error returned by handler.
Used for common default response.
func (UnimplementedHandler) NewMessage ¶
func (UnimplementedHandler) NewMessage(ctx context.Context, req *MessageRequest) (r *MessageResponse, _ error)
NewMessage implements NewMessage operation.
POST /v1/messages
func (UnimplementedHandler) NewPasswordResetToken ¶
func (UnimplementedHandler) NewPasswordResetToken(ctx context.Context, req *UserEmailRequest) (r *TokenResponse, _ error)
NewPasswordResetToken implements NewPasswordResetToken operation.
POST /v1/tokens/password-reset
func (UnimplementedHandler) NewRefreshToken ¶
func (UnimplementedHandler) NewRefreshToken(ctx context.Context, req *UserLoginRequest) (r *TokenResponseHeaders, _ error)
NewRefreshToken implements NewRefreshToken operation.
POST /v1/tokens/refresh
func (UnimplementedHandler) NewUser ¶
func (UnimplementedHandler) NewUser(ctx context.Context, req *UserRequest) (r *UserResponse, _ error)
NewUser implements NewUser operation.
POST /v1/users/register
func (UnimplementedHandler) UpdateMessage ¶
func (UnimplementedHandler) UpdateMessage(ctx context.Context, req *MessageRequest, params UpdateMessageParams) (r *MessageResponse, _ error)
UpdateMessage implements UpdateMessage operation.
PUT /v1/messages/{id}
func (UnimplementedHandler) UpdateUserPassword ¶
func (UnimplementedHandler) UpdateUserPassword(ctx context.Context, req *UpdateUserPasswordRequest) (r *AcceptanceResponse, _ error)
UpdateUserPassword implements UpdateUserPassword operation.
PATCH /v1/users/update-password
type UpdateMessageParams ¶
type UpdateMessageParams struct {
ID int64
}
UpdateMessageParams is parameters of UpdateMessage operation.
type UpdateUserPasswordRequest ¶
type UpdateUserPasswordRequest struct { Password string `json:"password"` Token string `json:"token"` }
Contains a password and token object. Ref: #/components/schemas/UpdateUserPasswordRequest
func (*UpdateUserPasswordRequest) Decode ¶
func (s *UpdateUserPasswordRequest) Decode(d *jx.Decoder) error
Decode decodes UpdateUserPasswordRequest from json.
func (*UpdateUserPasswordRequest) Encode ¶
func (s *UpdateUserPasswordRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdateUserPasswordRequest) GetPassword ¶
func (s *UpdateUserPasswordRequest) GetPassword() string
GetPassword returns the value of Password.
func (*UpdateUserPasswordRequest) GetToken ¶
func (s *UpdateUserPasswordRequest) GetToken() string
GetToken returns the value of Token.
func (*UpdateUserPasswordRequest) MarshalJSON ¶
func (s *UpdateUserPasswordRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateUserPasswordRequest) SetPassword ¶
func (s *UpdateUserPasswordRequest) SetPassword(val string)
SetPassword sets the value of Password.
func (*UpdateUserPasswordRequest) SetToken ¶
func (s *UpdateUserPasswordRequest) SetToken(val string)
SetToken sets the value of Token.
func (*UpdateUserPasswordRequest) UnmarshalJSON ¶
func (s *UpdateUserPasswordRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateUserPasswordRequest) Validate ¶
func (s *UpdateUserPasswordRequest) Validate() error
type UserEmailRequest ¶
type UserEmailRequest struct {
Email string `json:"email"`
}
Contains an email address. Ref: #/components/schemas/UserEmailRequest
func (*UserEmailRequest) Decode ¶
func (s *UserEmailRequest) Decode(d *jx.Decoder) error
Decode decodes UserEmailRequest from json.
func (*UserEmailRequest) Encode ¶
func (s *UserEmailRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UserEmailRequest) GetEmail ¶
func (s *UserEmailRequest) GetEmail() string
GetEmail returns the value of Email.
func (*UserEmailRequest) MarshalJSON ¶
func (s *UserEmailRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UserEmailRequest) SetEmail ¶
func (s *UserEmailRequest) SetEmail(val string)
SetEmail sets the value of Email.
func (*UserEmailRequest) UnmarshalJSON ¶
func (s *UserEmailRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UserEmailRequest) Validate ¶
func (s *UserEmailRequest) Validate() error
type UserLoginRequest ¶
Contains an email address and password. Ref: #/components/schemas/UserLoginRequest
func (*UserLoginRequest) Decode ¶
func (s *UserLoginRequest) Decode(d *jx.Decoder) error
Decode decodes UserLoginRequest from json.
func (*UserLoginRequest) Encode ¶
func (s *UserLoginRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UserLoginRequest) GetEmail ¶
func (s *UserLoginRequest) GetEmail() string
GetEmail returns the value of Email.
func (*UserLoginRequest) GetPassword ¶
func (s *UserLoginRequest) GetPassword() string
GetPassword returns the value of Password.
func (*UserLoginRequest) MarshalJSON ¶
func (s *UserLoginRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UserLoginRequest) SetEmail ¶
func (s *UserLoginRequest) SetEmail(val string)
SetEmail sets the value of Email.
func (*UserLoginRequest) SetPassword ¶
func (s *UserLoginRequest) SetPassword(val string)
SetPassword sets the value of Password.
func (*UserLoginRequest) UnmarshalJSON ¶
func (s *UserLoginRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UserLoginRequest) Validate ¶
func (s *UserLoginRequest) Validate() error
type UserRequest ¶
type UserRequest struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` }
Contains a username, email and password. Ref: #/components/schemas/UserRequest
func (*UserRequest) Decode ¶
func (s *UserRequest) Decode(d *jx.Decoder) error
Decode decodes UserRequest from json.
func (*UserRequest) Encode ¶
func (s *UserRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UserRequest) GetEmail ¶
func (s *UserRequest) GetEmail() string
GetEmail returns the value of Email.
func (*UserRequest) GetName ¶
func (s *UserRequest) GetName() string
GetName returns the value of Name.
func (*UserRequest) GetPassword ¶
func (s *UserRequest) GetPassword() string
GetPassword returns the value of Password.
func (*UserRequest) MarshalJSON ¶
func (s *UserRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UserRequest) SetEmail ¶
func (s *UserRequest) SetEmail(val string)
SetEmail sets the value of Email.
func (*UserRequest) SetName ¶
func (s *UserRequest) SetName(val string)
SetName sets the value of Name.
func (*UserRequest) SetPassword ¶
func (s *UserRequest) SetPassword(val string)
SetPassword sets the value of Password.
func (*UserRequest) UnmarshalJSON ¶
func (s *UserRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UserRequest) Validate ¶
func (s *UserRequest) Validate() error
type UserResponse ¶
type UserResponse struct { Name string `json:"name"` Email string `json:"email"` Version int32 `json:"version"` }
Contains a username, email and password. Ref: #/components/schemas/UserResponse
func (*UserResponse) Decode ¶
func (s *UserResponse) Decode(d *jx.Decoder) error
Decode decodes UserResponse from json.
func (*UserResponse) Encode ¶
func (s *UserResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UserResponse) GetEmail ¶
func (s *UserResponse) GetEmail() string
GetEmail returns the value of Email.
func (*UserResponse) GetName ¶
func (s *UserResponse) GetName() string
GetName returns the value of Name.
func (*UserResponse) GetVersion ¶
func (s *UserResponse) GetVersion() int32
GetVersion returns the value of Version.
func (*UserResponse) MarshalJSON ¶
func (s *UserResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UserResponse) SetEmail ¶
func (s *UserResponse) SetEmail(val string)
SetEmail sets the value of Email.
func (*UserResponse) SetName ¶
func (s *UserResponse) SetName(val string)
SetName sets the value of Name.
func (*UserResponse) SetVersion ¶
func (s *UserResponse) SetVersion(val int32)
SetVersion sets the value of Version.
func (*UserResponse) UnmarshalJSON ¶
func (s *UserResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UserResponse) Validate ¶
func (s *UserResponse) Validate() error