api

package
v0.0.0-...-9d184c9 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

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 Access

type Access struct {
	Token string
}

func (*Access) GetToken

func (s *Access) GetToken() string

GetToken returns the value of Token.

func (*Access) SetToken

func (s *Access) SetToken(val string)

SetToken sets the value of Token.

type DeleteMessageParams

type DeleteMessageParams struct {
	ID int64
}

DeleteMessageParams is parameters of DeleteMessage operation.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

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

type GetUserMessagesParams struct {
	Page     OptInt32
	PageSize OptInt32
}

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 Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptInt32

type OptInt32 struct {
	Value int32
	Set   bool
}

OptInt32 is optional int32.

func NewOptInt32

func NewOptInt32(v int32) OptInt32

NewOptInt32 returns new OptInt32 with value set to v.

func (OptInt32) Get

func (o OptInt32) Get() (v int32, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt32) IsSet

func (o OptInt32) IsSet() bool

IsSet returns true if OptInt32 was set.

func (OptInt32) Or

func (o OptInt32) Or(d int32) int32

Or returns value if set, or given parameter if does not.

func (*OptInt32) Reset

func (o *OptInt32) Reset()

Reset unsets value.

func (*OptInt32) SetTo

func (o *OptInt32) SetTo(v int32)

SetTo sets value to v.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value 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
}

func (*Refresh) GetAPIKey

func (s *Refresh) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*Refresh) SetAPIKey

func (s *Refresh) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

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.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

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

DeleteMessage implements DeleteMessage operation.

DELETE /v1/messages/{id}

func (UnimplementedHandler) GetMessage

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

NewError creates *ErrorResponseStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) NewMessage

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

NewRefreshToken implements NewRefreshToken operation.

POST /v1/tokens/refresh

func (UnimplementedHandler) NewUser

NewUser implements NewUser operation.

POST /v1/users/register

func (UnimplementedHandler) UpdateMessage

UpdateMessage implements UpdateMessage operation.

PUT /v1/messages/{id}

func (UnimplementedHandler) UpdateUserPassword

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

type UserLoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

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

Jump to

Keyboard shortcuts

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