httpapi

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var OpenAPIDoc []byte

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type AdminAuthResponse

type AdminAuthResponse struct {
	// PASETO access token.
	AccessToken string `json:"accessToken"`
	// Refresh token for obtaining new access tokens.
	RefreshToken string `json:"refreshToken"`
	// Access token expiration time in seconds.
	ExpiresIn int `json:"expiresIn"`
	// Access token absolute expiration time (ISO 8601 UTC).
	ExpiresAt time.Time `json:"expiresAt"`
	// Refresh token expiration time in seconds.
	RefreshExpiresIn int `json:"refreshExpiresIn"`
	// Refresh token absolute expiration time (ISO 8601 UTC).
	RefreshExpiresAt time.Time        `json:"refreshExpiresAt"`
	TokenType        string           `json:"tokenType"`
	User             AdminUserProfile `json:"user"`
}

Ref: #/components/schemas/AdminAuthResponse

func (*AdminAuthResponse) Decode

func (s *AdminAuthResponse) Decode(d *jx.Decoder) error

Decode decodes AdminAuthResponse from json.

func (*AdminAuthResponse) Encode

func (s *AdminAuthResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AdminAuthResponse) GetAccessToken

func (s *AdminAuthResponse) GetAccessToken() string

GetAccessToken returns the value of AccessToken.

func (*AdminAuthResponse) GetExpiresAt

func (s *AdminAuthResponse) GetExpiresAt() time.Time

GetExpiresAt returns the value of ExpiresAt.

func (*AdminAuthResponse) GetExpiresIn

func (s *AdminAuthResponse) GetExpiresIn() int

GetExpiresIn returns the value of ExpiresIn.

func (*AdminAuthResponse) GetRefreshExpiresAt

func (s *AdminAuthResponse) GetRefreshExpiresAt() time.Time

GetRefreshExpiresAt returns the value of RefreshExpiresAt.

func (*AdminAuthResponse) GetRefreshExpiresIn

func (s *AdminAuthResponse) GetRefreshExpiresIn() int

GetRefreshExpiresIn returns the value of RefreshExpiresIn.

func (*AdminAuthResponse) GetRefreshToken

func (s *AdminAuthResponse) GetRefreshToken() string

GetRefreshToken returns the value of RefreshToken.

func (*AdminAuthResponse) GetTokenType

func (s *AdminAuthResponse) GetTokenType() string

GetTokenType returns the value of TokenType.

func (*AdminAuthResponse) GetUser

func (s *AdminAuthResponse) GetUser() AdminUserProfile

GetUser returns the value of User.

func (*AdminAuthResponse) MarshalJSON

func (s *AdminAuthResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminAuthResponse) SetAccessToken

func (s *AdminAuthResponse) SetAccessToken(val string)

SetAccessToken sets the value of AccessToken.

func (*AdminAuthResponse) SetExpiresAt

func (s *AdminAuthResponse) SetExpiresAt(val time.Time)

SetExpiresAt sets the value of ExpiresAt.

func (*AdminAuthResponse) SetExpiresIn

func (s *AdminAuthResponse) SetExpiresIn(val int)

SetExpiresIn sets the value of ExpiresIn.

func (*AdminAuthResponse) SetRefreshExpiresAt

func (s *AdminAuthResponse) SetRefreshExpiresAt(val time.Time)

SetRefreshExpiresAt sets the value of RefreshExpiresAt.

func (*AdminAuthResponse) SetRefreshExpiresIn

func (s *AdminAuthResponse) SetRefreshExpiresIn(val int)

SetRefreshExpiresIn sets the value of RefreshExpiresIn.

func (*AdminAuthResponse) SetRefreshToken

func (s *AdminAuthResponse) SetRefreshToken(val string)

SetRefreshToken sets the value of RefreshToken.

func (*AdminAuthResponse) SetTokenType

func (s *AdminAuthResponse) SetTokenType(val string)

SetTokenType sets the value of TokenType.

func (*AdminAuthResponse) SetUser

func (s *AdminAuthResponse) SetUser(val AdminUserProfile)

SetUser sets the value of User.

func (*AdminAuthResponse) UnmarshalJSON

func (s *AdminAuthResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AdminAuthResponse) Validate

func (s *AdminAuthResponse) Validate() error

type AdminGetProfileInternalServerError

type AdminGetProfileInternalServerError Problem

func (*AdminGetProfileInternalServerError) Decode

Decode decodes AdminGetProfileInternalServerError from json.

func (*AdminGetProfileInternalServerError) Encode

Encode encodes AdminGetProfileInternalServerError as json.

func (*AdminGetProfileInternalServerError) MarshalJSON

func (s *AdminGetProfileInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminGetProfileInternalServerError) UnmarshalJSON

func (s *AdminGetProfileInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminGetProfileRes

type AdminGetProfileRes interface {
	// contains filtered or unexported methods
}

type AdminGetProfileUnauthorized

type AdminGetProfileUnauthorized Problem

func (*AdminGetProfileUnauthorized) Decode

Decode decodes AdminGetProfileUnauthorized from json.

func (*AdminGetProfileUnauthorized) Encode

func (s *AdminGetProfileUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminGetProfileUnauthorized as json.

func (*AdminGetProfileUnauthorized) MarshalJSON

func (s *AdminGetProfileUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminGetProfileUnauthorized) UnmarshalJSON

func (s *AdminGetProfileUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLoginBadRequest

type AdminLoginBadRequest Problem

func (*AdminLoginBadRequest) Decode

func (s *AdminLoginBadRequest) Decode(d *jx.Decoder) error

Decode decodes AdminLoginBadRequest from json.

func (*AdminLoginBadRequest) Encode

func (s *AdminLoginBadRequest) Encode(e *jx.Encoder)

Encode encodes AdminLoginBadRequest as json.

func (*AdminLoginBadRequest) MarshalJSON

func (s *AdminLoginBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLoginBadRequest) UnmarshalJSON

func (s *AdminLoginBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLoginForbidden

type AdminLoginForbidden Problem

func (*AdminLoginForbidden) Decode

func (s *AdminLoginForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminLoginForbidden from json.

func (*AdminLoginForbidden) Encode

func (s *AdminLoginForbidden) Encode(e *jx.Encoder)

Encode encodes AdminLoginForbidden as json.

func (*AdminLoginForbidden) MarshalJSON

func (s *AdminLoginForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLoginForbidden) UnmarshalJSON

func (s *AdminLoginForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLoginInternalServerError

type AdminLoginInternalServerError Problem

func (*AdminLoginInternalServerError) Decode

Decode decodes AdminLoginInternalServerError from json.

func (*AdminLoginInternalServerError) Encode

Encode encodes AdminLoginInternalServerError as json.

func (*AdminLoginInternalServerError) MarshalJSON

func (s *AdminLoginInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLoginInternalServerError) UnmarshalJSON

func (s *AdminLoginInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLoginRes

type AdminLoginRes interface {
	// contains filtered or unexported methods
}

type AdminLoginTooManyRequests

type AdminLoginTooManyRequests Problem

func (*AdminLoginTooManyRequests) Decode

func (s *AdminLoginTooManyRequests) Decode(d *jx.Decoder) error

Decode decodes AdminLoginTooManyRequests from json.

func (*AdminLoginTooManyRequests) Encode

func (s *AdminLoginTooManyRequests) Encode(e *jx.Encoder)

Encode encodes AdminLoginTooManyRequests as json.

func (*AdminLoginTooManyRequests) MarshalJSON

func (s *AdminLoginTooManyRequests) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLoginTooManyRequests) UnmarshalJSON

func (s *AdminLoginTooManyRequests) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLoginUnauthorized

type AdminLoginUnauthorized Problem

func (*AdminLoginUnauthorized) Decode

func (s *AdminLoginUnauthorized) Decode(d *jx.Decoder) error

Decode decodes AdminLoginUnauthorized from json.

func (*AdminLoginUnauthorized) Encode

func (s *AdminLoginUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminLoginUnauthorized as json.

func (*AdminLoginUnauthorized) MarshalJSON

func (s *AdminLoginUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLoginUnauthorized) UnmarshalJSON

func (s *AdminLoginUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLogoutInternalServerError

type AdminLogoutInternalServerError Problem

func (*AdminLogoutInternalServerError) Decode

Decode decodes AdminLogoutInternalServerError from json.

func (*AdminLogoutInternalServerError) Encode

Encode encodes AdminLogoutInternalServerError as json.

func (*AdminLogoutInternalServerError) MarshalJSON

func (s *AdminLogoutInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLogoutInternalServerError) UnmarshalJSON

func (s *AdminLogoutInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminLogoutNoContent

type AdminLogoutNoContent struct{}

AdminLogoutNoContent is response for AdminLogout operation.

type AdminLogoutRes

type AdminLogoutRes interface {
	// contains filtered or unexported methods
}

type AdminLogoutUnauthorized

type AdminLogoutUnauthorized Problem

func (*AdminLogoutUnauthorized) Decode

func (s *AdminLogoutUnauthorized) Decode(d *jx.Decoder) error

Decode decodes AdminLogoutUnauthorized from json.

func (*AdminLogoutUnauthorized) Encode

func (s *AdminLogoutUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminLogoutUnauthorized as json.

func (*AdminLogoutUnauthorized) MarshalJSON

func (s *AdminLogoutUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminLogoutUnauthorized) UnmarshalJSON

func (s *AdminLogoutUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminRole

type AdminRole string

func (*AdminRole) Decode

func (s *AdminRole) Decode(d *jx.Decoder) error

Decode decodes AdminRole from json.

func (AdminRole) Encode

func (s AdminRole) Encode(e *jx.Encoder)

Encode encodes AdminRole as json.

func (AdminRole) MarshalJSON

func (s AdminRole) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminRole) UnmarshalJSON

func (s *AdminRole) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (AdminRole) Validate

func (s AdminRole) Validate() error

type AdminUserCreateBadRequest

type AdminUserCreateBadRequest Problem

func (*AdminUserCreateBadRequest) Decode

func (s *AdminUserCreateBadRequest) Decode(d *jx.Decoder) error

Decode decodes AdminUserCreateBadRequest from json.

func (*AdminUserCreateBadRequest) Encode

func (s *AdminUserCreateBadRequest) Encode(e *jx.Encoder)

Encode encodes AdminUserCreateBadRequest as json.

func (*AdminUserCreateBadRequest) MarshalJSON

func (s *AdminUserCreateBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateBadRequest) UnmarshalJSON

func (s *AdminUserCreateBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserCreateConflict

type AdminUserCreateConflict Problem

func (*AdminUserCreateConflict) Decode

func (s *AdminUserCreateConflict) Decode(d *jx.Decoder) error

Decode decodes AdminUserCreateConflict from json.

func (*AdminUserCreateConflict) Encode

func (s *AdminUserCreateConflict) Encode(e *jx.Encoder)

Encode encodes AdminUserCreateConflict as json.

func (*AdminUserCreateConflict) MarshalJSON

func (s *AdminUserCreateConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateConflict) UnmarshalJSON

func (s *AdminUserCreateConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserCreateForbidden

type AdminUserCreateForbidden Problem

func (*AdminUserCreateForbidden) Decode

func (s *AdminUserCreateForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminUserCreateForbidden from json.

func (*AdminUserCreateForbidden) Encode

func (s *AdminUserCreateForbidden) Encode(e *jx.Encoder)

Encode encodes AdminUserCreateForbidden as json.

func (*AdminUserCreateForbidden) MarshalJSON

func (s *AdminUserCreateForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateForbidden) UnmarshalJSON

func (s *AdminUserCreateForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserCreateInternalServerError

type AdminUserCreateInternalServerError Problem

func (*AdminUserCreateInternalServerError) Decode

Decode decodes AdminUserCreateInternalServerError from json.

func (*AdminUserCreateInternalServerError) Encode

Encode encodes AdminUserCreateInternalServerError as json.

func (*AdminUserCreateInternalServerError) MarshalJSON

func (s *AdminUserCreateInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateInternalServerError) UnmarshalJSON

func (s *AdminUserCreateInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserCreateRequest

type AdminUserCreateRequest struct {
	Email string `json:"email"`
	// Must contain at least 8 characters, including uppercase, lowercase, and a number.
	Password string `json:"password"`
	// Letters, spaces, hyphens and apostrophes only.
	FirstName string `json:"firstName"`
	// Letters, spaces, hyphens and apostrophes only.
	LastName string    `json:"lastName"`
	Role     AdminRole `json:"role"`
}

Ref: #/components/schemas/AdminUserCreateRequest

func (*AdminUserCreateRequest) Decode

func (s *AdminUserCreateRequest) Decode(d *jx.Decoder) error

Decode decodes AdminUserCreateRequest from json.

func (*AdminUserCreateRequest) Encode

func (s *AdminUserCreateRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AdminUserCreateRequest) GetEmail

func (s *AdminUserCreateRequest) GetEmail() string

GetEmail returns the value of Email.

func (*AdminUserCreateRequest) GetFirstName

func (s *AdminUserCreateRequest) GetFirstName() string

GetFirstName returns the value of FirstName.

func (*AdminUserCreateRequest) GetLastName

func (s *AdminUserCreateRequest) GetLastName() string

GetLastName returns the value of LastName.

func (*AdminUserCreateRequest) GetPassword

func (s *AdminUserCreateRequest) GetPassword() string

GetPassword returns the value of Password.

func (*AdminUserCreateRequest) GetRole

func (s *AdminUserCreateRequest) GetRole() AdminRole

GetRole returns the value of Role.

func (*AdminUserCreateRequest) MarshalJSON

func (s *AdminUserCreateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateRequest) SetEmail

func (s *AdminUserCreateRequest) SetEmail(val string)

SetEmail sets the value of Email.

func (*AdminUserCreateRequest) SetFirstName

func (s *AdminUserCreateRequest) SetFirstName(val string)

SetFirstName sets the value of FirstName.

func (*AdminUserCreateRequest) SetLastName

func (s *AdminUserCreateRequest) SetLastName(val string)

SetLastName sets the value of LastName.

func (*AdminUserCreateRequest) SetPassword

func (s *AdminUserCreateRequest) SetPassword(val string)

SetPassword sets the value of Password.

func (*AdminUserCreateRequest) SetRole

func (s *AdminUserCreateRequest) SetRole(val AdminRole)

SetRole sets the value of Role.

func (*AdminUserCreateRequest) UnmarshalJSON

func (s *AdminUserCreateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AdminUserCreateRequest) Validate

func (s *AdminUserCreateRequest) Validate() error

type AdminUserCreateRes

type AdminUserCreateRes interface {
	// contains filtered or unexported methods
}

type AdminUserCreateUnauthorized

type AdminUserCreateUnauthorized Problem

func (*AdminUserCreateUnauthorized) Decode

Decode decodes AdminUserCreateUnauthorized from json.

func (*AdminUserCreateUnauthorized) Encode

func (s *AdminUserCreateUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminUserCreateUnauthorized as json.

func (*AdminUserCreateUnauthorized) MarshalJSON

func (s *AdminUserCreateUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserCreateUnauthorized) UnmarshalJSON

func (s *AdminUserCreateUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserDisableForbidden

type AdminUserDisableForbidden Problem

func (*AdminUserDisableForbidden) Decode

func (s *AdminUserDisableForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminUserDisableForbidden from json.

func (*AdminUserDisableForbidden) Encode

func (s *AdminUserDisableForbidden) Encode(e *jx.Encoder)

Encode encodes AdminUserDisableForbidden as json.

func (*AdminUserDisableForbidden) MarshalJSON

func (s *AdminUserDisableForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserDisableForbidden) UnmarshalJSON

func (s *AdminUserDisableForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserDisableInternalServerError

type AdminUserDisableInternalServerError Problem

func (*AdminUserDisableInternalServerError) Decode

Decode decodes AdminUserDisableInternalServerError from json.

func (*AdminUserDisableInternalServerError) Encode

Encode encodes AdminUserDisableInternalServerError as json.

func (*AdminUserDisableInternalServerError) MarshalJSON

func (s *AdminUserDisableInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserDisableInternalServerError) UnmarshalJSON

func (s *AdminUserDisableInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserDisableNoContent

type AdminUserDisableNoContent struct{}

AdminUserDisableNoContent is response for AdminUserDisable operation.

type AdminUserDisableNotFound

type AdminUserDisableNotFound Problem

func (*AdminUserDisableNotFound) Decode

func (s *AdminUserDisableNotFound) Decode(d *jx.Decoder) error

Decode decodes AdminUserDisableNotFound from json.

func (*AdminUserDisableNotFound) Encode

func (s *AdminUserDisableNotFound) Encode(e *jx.Encoder)

Encode encodes AdminUserDisableNotFound as json.

func (*AdminUserDisableNotFound) MarshalJSON

func (s *AdminUserDisableNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserDisableNotFound) UnmarshalJSON

func (s *AdminUserDisableNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserDisableParams

type AdminUserDisableParams struct {
	ID uuid.UUID
}

AdminUserDisableParams is parameters of adminUserDisable operation.

type AdminUserDisableRes

type AdminUserDisableRes interface {
	// contains filtered or unexported methods
}

type AdminUserDisableUnauthorized

type AdminUserDisableUnauthorized Problem

func (*AdminUserDisableUnauthorized) Decode

Decode decodes AdminUserDisableUnauthorized from json.

func (*AdminUserDisableUnauthorized) Encode

func (s *AdminUserDisableUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminUserDisableUnauthorized as json.

func (*AdminUserDisableUnauthorized) MarshalJSON

func (s *AdminUserDisableUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserDisableUnauthorized) UnmarshalJSON

func (s *AdminUserDisableUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserEnableForbidden

type AdminUserEnableForbidden Problem

func (*AdminUserEnableForbidden) Decode

func (s *AdminUserEnableForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminUserEnableForbidden from json.

func (*AdminUserEnableForbidden) Encode

func (s *AdminUserEnableForbidden) Encode(e *jx.Encoder)

Encode encodes AdminUserEnableForbidden as json.

func (*AdminUserEnableForbidden) MarshalJSON

func (s *AdminUserEnableForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserEnableForbidden) UnmarshalJSON

func (s *AdminUserEnableForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserEnableInternalServerError

type AdminUserEnableInternalServerError Problem

func (*AdminUserEnableInternalServerError) Decode

Decode decodes AdminUserEnableInternalServerError from json.

func (*AdminUserEnableInternalServerError) Encode

Encode encodes AdminUserEnableInternalServerError as json.

func (*AdminUserEnableInternalServerError) MarshalJSON

func (s *AdminUserEnableInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserEnableInternalServerError) UnmarshalJSON

func (s *AdminUserEnableInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserEnableNoContent

type AdminUserEnableNoContent struct{}

AdminUserEnableNoContent is response for AdminUserEnable operation.

type AdminUserEnableNotFound

type AdminUserEnableNotFound Problem

func (*AdminUserEnableNotFound) Decode

func (s *AdminUserEnableNotFound) Decode(d *jx.Decoder) error

Decode decodes AdminUserEnableNotFound from json.

func (*AdminUserEnableNotFound) Encode

func (s *AdminUserEnableNotFound) Encode(e *jx.Encoder)

Encode encodes AdminUserEnableNotFound as json.

func (*AdminUserEnableNotFound) MarshalJSON

func (s *AdminUserEnableNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserEnableNotFound) UnmarshalJSON

func (s *AdminUserEnableNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserEnableParams

type AdminUserEnableParams struct {
	ID uuid.UUID
}

AdminUserEnableParams is parameters of adminUserEnable operation.

type AdminUserEnableRes

type AdminUserEnableRes interface {
	// contains filtered or unexported methods
}

type AdminUserEnableUnauthorized

type AdminUserEnableUnauthorized Problem

func (*AdminUserEnableUnauthorized) Decode

Decode decodes AdminUserEnableUnauthorized from json.

func (*AdminUserEnableUnauthorized) Encode

func (s *AdminUserEnableUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminUserEnableUnauthorized as json.

func (*AdminUserEnableUnauthorized) MarshalJSON

func (s *AdminUserEnableUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserEnableUnauthorized) UnmarshalJSON

func (s *AdminUserEnableUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserGetByIdForbidden

type AdminUserGetByIdForbidden Problem

func (*AdminUserGetByIdForbidden) Decode

func (s *AdminUserGetByIdForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminUserGetByIdForbidden from json.

func (*AdminUserGetByIdForbidden) Encode

func (s *AdminUserGetByIdForbidden) Encode(e *jx.Encoder)

Encode encodes AdminUserGetByIdForbidden as json.

func (*AdminUserGetByIdForbidden) MarshalJSON

func (s *AdminUserGetByIdForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserGetByIdForbidden) UnmarshalJSON

func (s *AdminUserGetByIdForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserGetByIdInternalServerError

type AdminUserGetByIdInternalServerError Problem

func (*AdminUserGetByIdInternalServerError) Decode

Decode decodes AdminUserGetByIdInternalServerError from json.

func (*AdminUserGetByIdInternalServerError) Encode

Encode encodes AdminUserGetByIdInternalServerError as json.

func (*AdminUserGetByIdInternalServerError) MarshalJSON

func (s *AdminUserGetByIdInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserGetByIdInternalServerError) UnmarshalJSON

func (s *AdminUserGetByIdInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserGetByIdNotFound

type AdminUserGetByIdNotFound Problem

func (*AdminUserGetByIdNotFound) Decode

func (s *AdminUserGetByIdNotFound) Decode(d *jx.Decoder) error

Decode decodes AdminUserGetByIdNotFound from json.

func (*AdminUserGetByIdNotFound) Encode

func (s *AdminUserGetByIdNotFound) Encode(e *jx.Encoder)

Encode encodes AdminUserGetByIdNotFound as json.

func (*AdminUserGetByIdNotFound) MarshalJSON

func (s *AdminUserGetByIdNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserGetByIdNotFound) UnmarshalJSON

func (s *AdminUserGetByIdNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserGetByIdParams

type AdminUserGetByIdParams struct {
	ID uuid.UUID
}

AdminUserGetByIdParams is parameters of adminUserGetById operation.

type AdminUserGetByIdRes

type AdminUserGetByIdRes interface {
	// contains filtered or unexported methods
}

type AdminUserGetByIdUnauthorized

type AdminUserGetByIdUnauthorized Problem

func (*AdminUserGetByIdUnauthorized) Decode

Decode decodes AdminUserGetByIdUnauthorized from json.

func (*AdminUserGetByIdUnauthorized) Encode

func (s *AdminUserGetByIdUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminUserGetByIdUnauthorized as json.

func (*AdminUserGetByIdUnauthorized) MarshalJSON

func (s *AdminUserGetByIdUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserGetByIdUnauthorized) UnmarshalJSON

func (s *AdminUserGetByIdUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserListBadRequest

type AdminUserListBadRequest Problem

func (*AdminUserListBadRequest) Decode

func (s *AdminUserListBadRequest) Decode(d *jx.Decoder) error

Decode decodes AdminUserListBadRequest from json.

func (*AdminUserListBadRequest) Encode

func (s *AdminUserListBadRequest) Encode(e *jx.Encoder)

Encode encodes AdminUserListBadRequest as json.

func (*AdminUserListBadRequest) MarshalJSON

func (s *AdminUserListBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserListBadRequest) UnmarshalJSON

func (s *AdminUserListBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserListForbidden

type AdminUserListForbidden Problem

func (*AdminUserListForbidden) Decode

func (s *AdminUserListForbidden) Decode(d *jx.Decoder) error

Decode decodes AdminUserListForbidden from json.

func (*AdminUserListForbidden) Encode

func (s *AdminUserListForbidden) Encode(e *jx.Encoder)

Encode encodes AdminUserListForbidden as json.

func (*AdminUserListForbidden) MarshalJSON

func (s *AdminUserListForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserListForbidden) UnmarshalJSON

func (s *AdminUserListForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserListInternalServerError

type AdminUserListInternalServerError Problem

func (*AdminUserListInternalServerError) Decode

Decode decodes AdminUserListInternalServerError from json.

func (*AdminUserListInternalServerError) Encode

Encode encodes AdminUserListInternalServerError as json.

func (*AdminUserListInternalServerError) MarshalJSON

func (s *AdminUserListInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserListInternalServerError) UnmarshalJSON

func (s *AdminUserListInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserListParams

type AdminUserListParams struct {
	Page    int
	Size    int
	Role    OptAdminRole `json:",omitempty,omitzero"`
	Enabled OptBool      `json:",omitempty,omitzero"`
	// Search by name or email.
	Search OptString `json:",omitempty,omitzero"`
}

AdminUserListParams is parameters of adminUserList operation.

type AdminUserListRes

type AdminUserListRes interface {
	// contains filtered or unexported methods
}

type AdminUserListResponse

type AdminUserListResponse struct {
	Items []AdminUserResponse `json:"items"`
	Page  int                 `json:"page"`
	Size  int                 `json:"size"`
	Total int                 `json:"total"`
}

Ref: #/components/schemas/AdminUserListResponse

func (*AdminUserListResponse) Decode

func (s *AdminUserListResponse) Decode(d *jx.Decoder) error

Decode decodes AdminUserListResponse from json.

func (*AdminUserListResponse) Encode

func (s *AdminUserListResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AdminUserListResponse) GetItems

func (s *AdminUserListResponse) GetItems() []AdminUserResponse

GetItems returns the value of Items.

func (*AdminUserListResponse) GetPage

func (s *AdminUserListResponse) GetPage() int

GetPage returns the value of Page.

func (*AdminUserListResponse) GetSize

func (s *AdminUserListResponse) GetSize() int

GetSize returns the value of Size.

func (*AdminUserListResponse) GetTotal

func (s *AdminUserListResponse) GetTotal() int

GetTotal returns the value of Total.

func (*AdminUserListResponse) MarshalJSON

func (s *AdminUserListResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserListResponse) SetItems

func (s *AdminUserListResponse) SetItems(val []AdminUserResponse)

SetItems sets the value of Items.

func (*AdminUserListResponse) SetPage

func (s *AdminUserListResponse) SetPage(val int)

SetPage sets the value of Page.

func (*AdminUserListResponse) SetSize

func (s *AdminUserListResponse) SetSize(val int)

SetSize sets the value of Size.

func (*AdminUserListResponse) SetTotal

func (s *AdminUserListResponse) SetTotal(val int)

SetTotal sets the value of Total.

func (*AdminUserListResponse) UnmarshalJSON

func (s *AdminUserListResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AdminUserListResponse) Validate

func (s *AdminUserListResponse) Validate() error

type AdminUserListUnauthorized

type AdminUserListUnauthorized Problem

func (*AdminUserListUnauthorized) Decode

func (s *AdminUserListUnauthorized) Decode(d *jx.Decoder) error

Decode decodes AdminUserListUnauthorized from json.

func (*AdminUserListUnauthorized) Encode

func (s *AdminUserListUnauthorized) Encode(e *jx.Encoder)

Encode encodes AdminUserListUnauthorized as json.

func (*AdminUserListUnauthorized) MarshalJSON

func (s *AdminUserListUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserListUnauthorized) UnmarshalJSON

func (s *AdminUserListUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AdminUserProfile

type AdminUserProfile struct {
	ID        uuid.UUID `json:"id"`
	Email     string    `json:"email"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	Role      AdminRole `json:"role"`
	// Effective permissions based on role.
	Permissions []Permission `json:"permissions"`
	Enabled     bool         `json:"enabled"`
	CreatedAt   time.Time    `json:"createdAt"`
	LastLoginAt OptDateTime  `json:"lastLoginAt"`
}

Ref: #/components/schemas/AdminUserProfile

func (*AdminUserProfile) Decode

func (s *AdminUserProfile) Decode(d *jx.Decoder) error

Decode decodes AdminUserProfile from json.

func (*AdminUserProfile) Encode

func (s *AdminUserProfile) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AdminUserProfile) GetCreatedAt

func (s *AdminUserProfile) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AdminUserProfile) GetEmail

func (s *AdminUserProfile) GetEmail() string

GetEmail returns the value of Email.

func (*AdminUserProfile) GetEnabled

func (s *AdminUserProfile) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*AdminUserProfile) GetFirstName

func (s *AdminUserProfile) GetFirstName() string

GetFirstName returns the value of FirstName.

func (*AdminUserProfile) GetID

func (s *AdminUserProfile) GetID() uuid.UUID

GetID returns the value of ID.

func (*AdminUserProfile) GetLastLoginAt

func (s *AdminUserProfile) GetLastLoginAt() OptDateTime

GetLastLoginAt returns the value of LastLoginAt.

func (*AdminUserProfile) GetLastName

func (s *AdminUserProfile) GetLastName() string

GetLastName returns the value of LastName.

func (*AdminUserProfile) GetPermissions

func (s *AdminUserProfile) GetPermissions() []Permission

GetPermissions returns the value of Permissions.

func (*AdminUserProfile) GetRole

func (s *AdminUserProfile) GetRole() AdminRole

GetRole returns the value of Role.

func (*AdminUserProfile) MarshalJSON

func (s *AdminUserProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserProfile) SetCreatedAt

func (s *AdminUserProfile) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AdminUserProfile) SetEmail

func (s *AdminUserProfile) SetEmail(val string)

SetEmail sets the value of Email.

func (*AdminUserProfile) SetEnabled

func (s *AdminUserProfile) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*AdminUserProfile) SetFirstName

func (s *AdminUserProfile) SetFirstName(val string)

SetFirstName sets the value of FirstName.

func (*AdminUserProfile) SetID

func (s *AdminUserProfile) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*AdminUserProfile) SetLastLoginAt

func (s *AdminUserProfile) SetLastLoginAt(val OptDateTime)

SetLastLoginAt sets the value of LastLoginAt.

func (*AdminUserProfile) SetLastName

func (s *AdminUserProfile) SetLastName(val string)

SetLastName sets the value of LastName.

func (*AdminUserProfile) SetPermissions

func (s *AdminUserProfile) SetPermissions(val []Permission)

SetPermissions sets the value of Permissions.

func (*AdminUserProfile) SetRole

func (s *AdminUserProfile) SetRole(val AdminRole)

SetRole sets the value of Role.

func (*AdminUserProfile) UnmarshalJSON

func (s *AdminUserProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AdminUserProfile) Validate

func (s *AdminUserProfile) Validate() error

type AdminUserResponse

type AdminUserResponse struct {
	ID          uuid.UUID   `json:"id"`
	Email       string      `json:"email"`
	FirstName   string      `json:"firstName"`
	LastName    string      `json:"lastName"`
	Role        AdminRole   `json:"role"`
	Enabled     bool        `json:"enabled"`
	CreatedAt   time.Time   `json:"createdAt"`
	ModifiedAt  OptDateTime `json:"modifiedAt"`
	LastLoginAt OptDateTime `json:"lastLoginAt"`
}

Ref: #/components/schemas/AdminUserResponse

func (*AdminUserResponse) Decode

func (s *AdminUserResponse) Decode(d *jx.Decoder) error

Decode decodes AdminUserResponse from json.

func (*AdminUserResponse) Encode

func (s *AdminUserResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AdminUserResponse) GetCreatedAt

func (s *AdminUserResponse) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AdminUserResponse) GetEmail

func (s *AdminUserResponse) GetEmail() string

GetEmail returns the value of Email.

func (*AdminUserResponse) GetEnabled

func (s *AdminUserResponse) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*AdminUserResponse) GetFirstName

func (s *AdminUserResponse) GetFirstName() string

GetFirstName returns the value of FirstName.

func (*AdminUserResponse) GetID

func (s *AdminUserResponse) GetID() uuid.UUID

GetID returns the value of ID.

func (*AdminUserResponse) GetLastLoginAt

func (s *AdminUserResponse) GetLastLoginAt() OptDateTime

GetLastLoginAt returns the value of LastLoginAt.

func (*AdminUserResponse) GetLastName

func (s *AdminUserResponse) GetLastName() string

GetLastName returns the value of LastName.

func (*AdminUserResponse) GetModifiedAt

func (s *AdminUserResponse) GetModifiedAt() OptDateTime

GetModifiedAt returns the value of ModifiedAt.

func (*AdminUserResponse) GetRole

func (s *AdminUserResponse) GetRole() AdminRole

GetRole returns the value of Role.

func (*AdminUserResponse) MarshalJSON

func (s *AdminUserResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AdminUserResponse) SetCreatedAt

func (s *AdminUserResponse) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AdminUserResponse) SetEmail

func (s *AdminUserResponse) SetEmail(val string)

SetEmail sets the value of Email.

func (*AdminUserResponse) SetEnabled

func (s *AdminUserResponse) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*AdminUserResponse) SetFirstName

func (s *AdminUserResponse) SetFirstName(val string)

SetFirstName sets the value of FirstName.

func (*AdminUserResponse) SetID

func (s *AdminUserResponse) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*AdminUserResponse) SetLastLoginAt

func (s *AdminUserResponse) SetLastLoginAt(val OptDateTime)

SetLastLoginAt sets the value of LastLoginAt.

func (*AdminUserResponse) SetLastName

func (s *AdminUserResponse) SetLastName(val string)

SetLastName sets the value of LastName.

func (*AdminUserResponse) SetModifiedAt

func (s *AdminUserResponse) SetModifiedAt(val OptDateTime)

SetModifiedAt sets the value of ModifiedAt.

func (*AdminUserResponse) SetRole

func (s *AdminUserResponse) SetRole(val AdminRole)

SetRole sets the value of Role.

func (*AdminUserResponse) UnmarshalJSON

func (s *AdminUserResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AdminUserResponse) Validate

func (s *AdminUserResponse) Validate() error

type BearerAuth

type BearerAuth struct {
	Token string
	Roles []string
}

func (*BearerAuth) GetRoles

func (s *BearerAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*BearerAuth) GetToken

func (s *BearerAuth) GetToken() string

GetToken returns the value of Token.

func (*BearerAuth) SetRoles

func (s *BearerAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

func (*BearerAuth) SetToken

func (s *BearerAuth) SetToken(val string)

SetToken sets the value of Token.

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) AdminGetProfile

func (c *Client) AdminGetProfile(ctx context.Context) (AdminGetProfileRes, error)

AdminGetProfile invokes adminGetProfile operation.

Get current admin user profile.

GET /v1/admin/me

func (*Client) AdminLogin

func (c *Client) AdminLogin(ctx context.Context, request *LoginRequest) (AdminLoginRes, error)

AdminLogin invokes adminLogin operation.

Admin user login.

POST /v1/admin/login

func (*Client) AdminLogout

func (c *Client) AdminLogout(ctx context.Context) (AdminLogoutRes, error)

AdminLogout invokes adminLogout operation.

Logout current user (invalidate refresh token).

POST /v1/admin/logout

func (*Client) AdminUserCreate

func (c *Client) AdminUserCreate(ctx context.Context, request *AdminUserCreateRequest) (AdminUserCreateRes, error)

AdminUserCreate invokes adminUserCreate operation.

Create a new admin user.

POST /v1/admin/users/create

func (*Client) AdminUserDisable

func (c *Client) AdminUserDisable(ctx context.Context, params AdminUserDisableParams) (AdminUserDisableRes, error)

AdminUserDisable invokes adminUserDisable operation.

Disable an admin user.

POST /v1/admin/users/disable/{id}

func (*Client) AdminUserEnable

func (c *Client) AdminUserEnable(ctx context.Context, params AdminUserEnableParams) (AdminUserEnableRes, error)

AdminUserEnable invokes adminUserEnable operation.

Enable an admin user.

POST /v1/admin/users/enable/{id}

func (*Client) AdminUserGetById

func (c *Client) AdminUserGetById(ctx context.Context, params AdminUserGetByIdParams) (AdminUserGetByIdRes, error)

AdminUserGetById invokes adminUserGetById operation.

Get admin user by ID.

GET /v1/admin/users/get/{id}

func (*Client) AdminUserList

func (c *Client) AdminUserList(ctx context.Context, params AdminUserListParams) (AdminUserListRes, error)

AdminUserList invokes adminUserList operation.

List admin users with pagination.

GET /v1/admin/users/list

func (*Client) GetRoles

func (c *Client) GetRoles(ctx context.Context) (GetRolesRes, error)

GetRoles invokes getRoles operation.

Get all available roles.

GET /v1/roles

func (*Client) TokenRefresh

func (c *Client) TokenRefresh(ctx context.Context, request *TokenRefreshRequest) (TokenRefreshRes, error)

TokenRefresh invokes tokenRefresh operation.

Refresh access token using refresh token.

POST /v1/token/refresh

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type GetRolesInternalServerError

type GetRolesInternalServerError Problem

func (*GetRolesInternalServerError) Decode

Decode decodes GetRolesInternalServerError from json.

func (*GetRolesInternalServerError) Encode

func (s *GetRolesInternalServerError) Encode(e *jx.Encoder)

Encode encodes GetRolesInternalServerError as json.

func (*GetRolesInternalServerError) MarshalJSON

func (s *GetRolesInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetRolesInternalServerError) UnmarshalJSON

func (s *GetRolesInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetRolesRes

type GetRolesRes interface {
	// contains filtered or unexported methods
}

type GetRolesUnauthorized

type GetRolesUnauthorized Problem

func (*GetRolesUnauthorized) Decode

func (s *GetRolesUnauthorized) Decode(d *jx.Decoder) error

Decode decodes GetRolesUnauthorized from json.

func (*GetRolesUnauthorized) Encode

func (s *GetRolesUnauthorized) Encode(e *jx.Encoder)

Encode encodes GetRolesUnauthorized as json.

func (*GetRolesUnauthorized) MarshalJSON

func (s *GetRolesUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetRolesUnauthorized) UnmarshalJSON

func (s *GetRolesUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// AdminGetProfile implements adminGetProfile operation.
	//
	// Get current admin user profile.
	//
	// GET /v1/admin/me
	AdminGetProfile(ctx context.Context) (AdminGetProfileRes, error)
	// AdminLogin implements adminLogin operation.
	//
	// Admin user login.
	//
	// POST /v1/admin/login
	AdminLogin(ctx context.Context, req *LoginRequest) (AdminLoginRes, error)
	// AdminLogout implements adminLogout operation.
	//
	// Logout current user (invalidate refresh token).
	//
	// POST /v1/admin/logout
	AdminLogout(ctx context.Context) (AdminLogoutRes, error)
	// AdminUserCreate implements adminUserCreate operation.
	//
	// Create a new admin user.
	//
	// POST /v1/admin/users/create
	AdminUserCreate(ctx context.Context, req *AdminUserCreateRequest) (AdminUserCreateRes, error)
	// AdminUserDisable implements adminUserDisable operation.
	//
	// Disable an admin user.
	//
	// POST /v1/admin/users/disable/{id}
	AdminUserDisable(ctx context.Context, params AdminUserDisableParams) (AdminUserDisableRes, error)
	// AdminUserEnable implements adminUserEnable operation.
	//
	// Enable an admin user.
	//
	// POST /v1/admin/users/enable/{id}
	AdminUserEnable(ctx context.Context, params AdminUserEnableParams) (AdminUserEnableRes, error)
	// AdminUserGetById implements adminUserGetById operation.
	//
	// Get admin user by ID.
	//
	// GET /v1/admin/users/get/{id}
	AdminUserGetById(ctx context.Context, params AdminUserGetByIdParams) (AdminUserGetByIdRes, error)
	// AdminUserList implements adminUserList operation.
	//
	// List admin users with pagination.
	//
	// GET /v1/admin/users/list
	AdminUserList(ctx context.Context, params AdminUserListParams) (AdminUserListRes, error)
	// GetRoles implements getRoles operation.
	//
	// Get all available roles.
	//
	// GET /v1/roles
	GetRoles(ctx context.Context) (GetRolesRes, error)
	// TokenRefresh implements tokenRefresh operation.
	//
	// Refresh access token using refresh token.
	//
	// POST /v1/token/refresh
	TokenRefresh(ctx context.Context, req *TokenRefreshRequest) (TokenRefreshRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// AdminGetProfile invokes adminGetProfile operation.
	//
	// Get current admin user profile.
	//
	// GET /v1/admin/me
	AdminGetProfile(ctx context.Context) (AdminGetProfileRes, error)
	// AdminLogin invokes adminLogin operation.
	//
	// Admin user login.
	//
	// POST /v1/admin/login
	AdminLogin(ctx context.Context, request *LoginRequest) (AdminLoginRes, error)
	// AdminLogout invokes adminLogout operation.
	//
	// Logout current user (invalidate refresh token).
	//
	// POST /v1/admin/logout
	AdminLogout(ctx context.Context) (AdminLogoutRes, error)
	// AdminUserCreate invokes adminUserCreate operation.
	//
	// Create a new admin user.
	//
	// POST /v1/admin/users/create
	AdminUserCreate(ctx context.Context, request *AdminUserCreateRequest) (AdminUserCreateRes, error)
	// AdminUserDisable invokes adminUserDisable operation.
	//
	// Disable an admin user.
	//
	// POST /v1/admin/users/disable/{id}
	AdminUserDisable(ctx context.Context, params AdminUserDisableParams) (AdminUserDisableRes, error)
	// AdminUserEnable invokes adminUserEnable operation.
	//
	// Enable an admin user.
	//
	// POST /v1/admin/users/enable/{id}
	AdminUserEnable(ctx context.Context, params AdminUserEnableParams) (AdminUserEnableRes, error)
	// AdminUserGetById invokes adminUserGetById operation.
	//
	// Get admin user by ID.
	//
	// GET /v1/admin/users/get/{id}
	AdminUserGetById(ctx context.Context, params AdminUserGetByIdParams) (AdminUserGetByIdRes, error)
	// AdminUserList invokes adminUserList operation.
	//
	// List admin users with pagination.
	//
	// GET /v1/admin/users/list
	AdminUserList(ctx context.Context, params AdminUserListParams) (AdminUserListRes, error)
	// GetRoles invokes getRoles operation.
	//
	// Get all available roles.
	//
	// GET /v1/roles
	GetRoles(ctx context.Context) (GetRolesRes, error)
	// TokenRefresh invokes tokenRefresh operation.
	//
	// Refresh access token using refresh token.
	//
	// POST /v1/token/refresh
	TokenRefresh(ctx context.Context, request *TokenRefreshRequest) (TokenRefreshRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type LoginRequest

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

Ref: #/components/schemas/LoginRequest

func (*LoginRequest) Decode

func (s *LoginRequest) Decode(d *jx.Decoder) error

Decode decodes LoginRequest from json.

func (*LoginRequest) Encode

func (s *LoginRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LoginRequest) GetEmail

func (s *LoginRequest) GetEmail() string

GetEmail returns the value of Email.

func (*LoginRequest) GetPassword

func (s *LoginRequest) GetPassword() string

GetPassword returns the value of Password.

func (*LoginRequest) MarshalJSON

func (s *LoginRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LoginRequest) SetEmail

func (s *LoginRequest) SetEmail(val string)

SetEmail sets the value of Email.

func (*LoginRequest) SetPassword

func (s *LoginRequest) SetPassword(val string)

SetPassword sets the value of Password.

func (*LoginRequest) UnmarshalJSON

func (s *LoginRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LoginRequest) Validate

func (s *LoginRequest) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	AdminGetProfileOperation  OperationName = "AdminGetProfile"
	AdminLoginOperation       OperationName = "AdminLogin"
	AdminLogoutOperation      OperationName = "AdminLogout"
	AdminUserCreateOperation  OperationName = "AdminUserCreate"
	AdminUserDisableOperation OperationName = "AdminUserDisable"
	AdminUserEnableOperation  OperationName = "AdminUserEnable"
	AdminUserGetByIdOperation OperationName = "AdminUserGetById"
	AdminUserListOperation    OperationName = "AdminUserList"
	GetRolesOperation         OperationName = "GetRoles"
	TokenRefreshOperation     OperationName = "TokenRefresh"
)

type OptAdminRole

type OptAdminRole struct {
	Value AdminRole
	Set   bool
}

OptAdminRole is optional AdminRole.

func NewOptAdminRole

func NewOptAdminRole(v AdminRole) OptAdminRole

NewOptAdminRole returns new OptAdminRole with value set to v.

func (*OptAdminRole) Decode

func (o *OptAdminRole) Decode(d *jx.Decoder) error

Decode decodes AdminRole from json.

func (OptAdminRole) Encode

func (o OptAdminRole) Encode(e *jx.Encoder)

Encode encodes AdminRole as json.

func (OptAdminRole) Get

func (o OptAdminRole) Get() (v AdminRole, ok bool)

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

func (OptAdminRole) IsSet

func (o OptAdminRole) IsSet() bool

IsSet returns true if OptAdminRole was set.

func (OptAdminRole) MarshalJSON

func (s OptAdminRole) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptAdminRole) Or

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

func (*OptAdminRole) Reset

func (o *OptAdminRole) Reset()

Reset unsets value.

func (*OptAdminRole) SetTo

func (o *OptAdminRole) SetTo(v AdminRole)

SetTo sets value to v.

func (*OptAdminRole) UnmarshalJSON

func (s *OptAdminRole) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

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

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

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

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

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

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

func (s OptDateTime) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

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

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

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) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

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) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

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.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptURI

type OptURI struct {
	Value url.URL
	Set   bool
}

OptURI is optional url.URL.

func NewOptURI

func NewOptURI(v url.URL) OptURI

NewOptURI returns new OptURI with value set to v.

func (*OptURI) Decode

func (o *OptURI) Decode(d *jx.Decoder) error

Decode decodes url.URL from json.

func (OptURI) Encode

func (o OptURI) Encode(e *jx.Encoder)

Encode encodes url.URL as json.

func (OptURI) Get

func (o OptURI) Get() (v url.URL, ok bool)

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

func (OptURI) IsSet

func (o OptURI) IsSet() bool

IsSet returns true if OptURI was set.

func (OptURI) MarshalJSON

func (s OptURI) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptURI) Or

func (o OptURI) Or(d url.URL) url.URL

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

func (*OptURI) Reset

func (o *OptURI) Reset()

Reset unsets value.

func (*OptURI) SetTo

func (o *OptURI) SetTo(v url.URL)

SetTo sets value to v.

func (*OptURI) UnmarshalJSON

func (s *OptURI) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() 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 Permission

type Permission string

func (*Permission) Decode

func (s *Permission) Decode(d *jx.Decoder) error

Decode decodes Permission from json.

func (Permission) Encode

func (s Permission) Encode(e *jx.Encoder)

Encode encodes Permission as json.

func (Permission) MarshalJSON

func (s Permission) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Permission) UnmarshalJSON

func (s *Permission) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Permission) Validate

func (s Permission) Validate() error

type Problem

type Problem struct {
	Type     url.URL             `json:"type"`
	Title    string              `json:"title"`
	Status   int                 `json:"status"`
	Detail   OptString           `json:"detail"`
	Instance OptURI              `json:"instance"`
	TraceId  OptString           `json:"traceId"`
	Errors   []ProblemErrorsItem `json:"errors"`
}

RFC7807 Problem Details. Ref: #/components/schemas/Problem

func (*Problem) Decode

func (s *Problem) Decode(d *jx.Decoder) error

Decode decodes Problem from json.

func (*Problem) Encode

func (s *Problem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Problem) GetDetail

func (s *Problem) GetDetail() OptString

GetDetail returns the value of Detail.

func (*Problem) GetErrors

func (s *Problem) GetErrors() []ProblemErrorsItem

GetErrors returns the value of Errors.

func (*Problem) GetInstance

func (s *Problem) GetInstance() OptURI

GetInstance returns the value of Instance.

func (*Problem) GetStatus

func (s *Problem) GetStatus() int

GetStatus returns the value of Status.

func (*Problem) GetTitle

func (s *Problem) GetTitle() string

GetTitle returns the value of Title.

func (*Problem) GetTraceId

func (s *Problem) GetTraceId() OptString

GetTraceId returns the value of TraceId.

func (*Problem) GetType

func (s *Problem) GetType() url.URL

GetType returns the value of Type.

func (*Problem) MarshalJSON

func (s *Problem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Problem) SetDetail

func (s *Problem) SetDetail(val OptString)

SetDetail sets the value of Detail.

func (*Problem) SetErrors

func (s *Problem) SetErrors(val []ProblemErrorsItem)

SetErrors sets the value of Errors.

func (*Problem) SetInstance

func (s *Problem) SetInstance(val OptURI)

SetInstance sets the value of Instance.

func (*Problem) SetStatus

func (s *Problem) SetStatus(val int)

SetStatus sets the value of Status.

func (*Problem) SetTitle

func (s *Problem) SetTitle(val string)

SetTitle sets the value of Title.

func (*Problem) SetTraceId

func (s *Problem) SetTraceId(val OptString)

SetTraceId sets the value of TraceId.

func (*Problem) SetType

func (s *Problem) SetType(val url.URL)

SetType sets the value of Type.

func (*Problem) UnmarshalJSON

func (s *Problem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProblemErrorsItem

type ProblemErrorsItem struct {
	Field   OptString `json:"field"`
	Message OptString `json:"message"`
}

func (*ProblemErrorsItem) Decode

func (s *ProblemErrorsItem) Decode(d *jx.Decoder) error

Decode decodes ProblemErrorsItem from json.

func (*ProblemErrorsItem) Encode

func (s *ProblemErrorsItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ProblemErrorsItem) GetField

func (s *ProblemErrorsItem) GetField() OptString

GetField returns the value of Field.

func (*ProblemErrorsItem) GetMessage

func (s *ProblemErrorsItem) GetMessage() OptString

GetMessage returns the value of Message.

func (*ProblemErrorsItem) MarshalJSON

func (s *ProblemErrorsItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProblemErrorsItem) SetField

func (s *ProblemErrorsItem) SetField(val OptString)

SetField sets the value of Field.

func (*ProblemErrorsItem) SetMessage

func (s *ProblemErrorsItem) SetMessage(val OptString)

SetMessage sets the value of Message.

func (*ProblemErrorsItem) UnmarshalJSON

func (s *ProblemErrorsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RoleInfo

type RoleInfo struct {
	Name        AdminRole    `json:"name"`
	Description string       `json:"description"`
	Permissions []Permission `json:"permissions"`
}

Ref: #/components/schemas/RoleInfo

func (*RoleInfo) Decode

func (s *RoleInfo) Decode(d *jx.Decoder) error

Decode decodes RoleInfo from json.

func (*RoleInfo) Encode

func (s *RoleInfo) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RoleInfo) GetDescription

func (s *RoleInfo) GetDescription() string

GetDescription returns the value of Description.

func (*RoleInfo) GetName

func (s *RoleInfo) GetName() AdminRole

GetName returns the value of Name.

func (*RoleInfo) GetPermissions

func (s *RoleInfo) GetPermissions() []Permission

GetPermissions returns the value of Permissions.

func (*RoleInfo) MarshalJSON

func (s *RoleInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RoleInfo) SetDescription

func (s *RoleInfo) SetDescription(val string)

SetDescription sets the value of Description.

func (*RoleInfo) SetName

func (s *RoleInfo) SetName(val AdminRole)

SetName sets the value of Name.

func (*RoleInfo) SetPermissions

func (s *RoleInfo) SetPermissions(val []Permission)

SetPermissions sets the value of Permissions.

func (*RoleInfo) UnmarshalJSON

func (s *RoleInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RoleInfo) Validate

func (s *RoleInfo) Validate() error

type RolesResponse

type RolesResponse struct {
	Roles []RoleInfo `json:"roles"`
}

Ref: #/components/schemas/RolesResponse

func (*RolesResponse) Decode

func (s *RolesResponse) Decode(d *jx.Decoder) error

Decode decodes RolesResponse from json.

func (*RolesResponse) Encode

func (s *RolesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RolesResponse) GetRoles

func (s *RolesResponse) GetRoles() []RoleInfo

GetRoles returns the value of Roles.

func (*RolesResponse) MarshalJSON

func (s *RolesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RolesResponse) SetRoles

func (s *RolesResponse) SetRoles(val []RoleInfo)

SetRoles sets the value of Roles.

func (*RolesResponse) UnmarshalJSON

func (s *RolesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RolesResponse) Validate

func (s *RolesResponse) Validate() error

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) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type SecurityHandler

type SecurityHandler interface {
	// HandleBearerAuth handles BearerAuth security.
	// PASETO token in Authorization header.
	HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// BearerAuth provides BearerAuth security value.
	// PASETO token in Authorization header.
	BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

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 ProvideServer added in v1.0.5

func ProvideServer(
	handler Handler,
	securityHandler SecurityHandler,
	tracerProvider trace.TracerProvider,
	meterProvider metric.MeterProvider,
	middlewares []middleware.Middleware,
	errorHandler ogenerrors.ErrorHandler,
) (*Server, error)

ProvideServer creates an ogen server with security handler for fx DI.

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 TokenRefreshBadRequest

type TokenRefreshBadRequest Problem

func (*TokenRefreshBadRequest) Decode

func (s *TokenRefreshBadRequest) Decode(d *jx.Decoder) error

Decode decodes TokenRefreshBadRequest from json.

func (*TokenRefreshBadRequest) Encode

func (s *TokenRefreshBadRequest) Encode(e *jx.Encoder)

Encode encodes TokenRefreshBadRequest as json.

func (*TokenRefreshBadRequest) MarshalJSON

func (s *TokenRefreshBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenRefreshBadRequest) UnmarshalJSON

func (s *TokenRefreshBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TokenRefreshInternalServerError

type TokenRefreshInternalServerError Problem

func (*TokenRefreshInternalServerError) Decode

Decode decodes TokenRefreshInternalServerError from json.

func (*TokenRefreshInternalServerError) Encode

Encode encodes TokenRefreshInternalServerError as json.

func (*TokenRefreshInternalServerError) MarshalJSON

func (s *TokenRefreshInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenRefreshInternalServerError) UnmarshalJSON

func (s *TokenRefreshInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TokenRefreshRequest

type TokenRefreshRequest struct {
	// The refresh token.
	RefreshToken string `json:"refreshToken"`
}

Ref: #/components/schemas/TokenRefreshRequest

func (*TokenRefreshRequest) Decode

func (s *TokenRefreshRequest) Decode(d *jx.Decoder) error

Decode decodes TokenRefreshRequest from json.

func (*TokenRefreshRequest) Encode

func (s *TokenRefreshRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TokenRefreshRequest) GetRefreshToken

func (s *TokenRefreshRequest) GetRefreshToken() string

GetRefreshToken returns the value of RefreshToken.

func (*TokenRefreshRequest) MarshalJSON

func (s *TokenRefreshRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenRefreshRequest) SetRefreshToken

func (s *TokenRefreshRequest) SetRefreshToken(val string)

SetRefreshToken sets the value of RefreshToken.

func (*TokenRefreshRequest) UnmarshalJSON

func (s *TokenRefreshRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TokenRefreshRes

type TokenRefreshRes interface {
	// contains filtered or unexported methods
}

type TokenRefreshResponse

type TokenRefreshResponse struct {
	AccessToken string `json:"accessToken"`
	// New refresh token (token rotation).
	RefreshToken string `json:"refreshToken"`
	// Access token expiration time in seconds.
	ExpiresIn int `json:"expiresIn"`
	// Access token absolute expiration time (ISO 8601 UTC).
	ExpiresAt time.Time `json:"expiresAt"`
	// Refresh token expiration time in seconds.
	RefreshExpiresIn int `json:"refreshExpiresIn"`
	// Refresh token absolute expiration time (ISO 8601 UTC).
	RefreshExpiresAt time.Time `json:"refreshExpiresAt"`
}

Ref: #/components/schemas/TokenRefreshResponse

func (*TokenRefreshResponse) Decode

func (s *TokenRefreshResponse) Decode(d *jx.Decoder) error

Decode decodes TokenRefreshResponse from json.

func (*TokenRefreshResponse) Encode

func (s *TokenRefreshResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TokenRefreshResponse) GetAccessToken

func (s *TokenRefreshResponse) GetAccessToken() string

GetAccessToken returns the value of AccessToken.

func (*TokenRefreshResponse) GetExpiresAt

func (s *TokenRefreshResponse) GetExpiresAt() time.Time

GetExpiresAt returns the value of ExpiresAt.

func (*TokenRefreshResponse) GetExpiresIn

func (s *TokenRefreshResponse) GetExpiresIn() int

GetExpiresIn returns the value of ExpiresIn.

func (*TokenRefreshResponse) GetRefreshExpiresAt

func (s *TokenRefreshResponse) GetRefreshExpiresAt() time.Time

GetRefreshExpiresAt returns the value of RefreshExpiresAt.

func (*TokenRefreshResponse) GetRefreshExpiresIn

func (s *TokenRefreshResponse) GetRefreshExpiresIn() int

GetRefreshExpiresIn returns the value of RefreshExpiresIn.

func (*TokenRefreshResponse) GetRefreshToken

func (s *TokenRefreshResponse) GetRefreshToken() string

GetRefreshToken returns the value of RefreshToken.

func (*TokenRefreshResponse) MarshalJSON

func (s *TokenRefreshResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenRefreshResponse) SetAccessToken

func (s *TokenRefreshResponse) SetAccessToken(val string)

SetAccessToken sets the value of AccessToken.

func (*TokenRefreshResponse) SetExpiresAt

func (s *TokenRefreshResponse) SetExpiresAt(val time.Time)

SetExpiresAt sets the value of ExpiresAt.

func (*TokenRefreshResponse) SetExpiresIn

func (s *TokenRefreshResponse) SetExpiresIn(val int)

SetExpiresIn sets the value of ExpiresIn.

func (*TokenRefreshResponse) SetRefreshExpiresAt

func (s *TokenRefreshResponse) SetRefreshExpiresAt(val time.Time)

SetRefreshExpiresAt sets the value of RefreshExpiresAt.

func (*TokenRefreshResponse) SetRefreshExpiresIn

func (s *TokenRefreshResponse) SetRefreshExpiresIn(val int)

SetRefreshExpiresIn sets the value of RefreshExpiresIn.

func (*TokenRefreshResponse) SetRefreshToken

func (s *TokenRefreshResponse) SetRefreshToken(val string)

SetRefreshToken sets the value of RefreshToken.

func (*TokenRefreshResponse) UnmarshalJSON

func (s *TokenRefreshResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TokenRefreshUnauthorized

type TokenRefreshUnauthorized Problem

func (*TokenRefreshUnauthorized) Decode

func (s *TokenRefreshUnauthorized) Decode(d *jx.Decoder) error

Decode decodes TokenRefreshUnauthorized from json.

func (*TokenRefreshUnauthorized) Encode

func (s *TokenRefreshUnauthorized) Encode(e *jx.Encoder)

Encode encodes TokenRefreshUnauthorized as json.

func (*TokenRefreshUnauthorized) MarshalJSON

func (s *TokenRefreshUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenRefreshUnauthorized) UnmarshalJSON

func (s *TokenRefreshUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) AdminGetProfile

func (UnimplementedHandler) AdminGetProfile(ctx context.Context) (r AdminGetProfileRes, _ error)

AdminGetProfile implements adminGetProfile operation.

Get current admin user profile.

GET /v1/admin/me

func (UnimplementedHandler) AdminLogin

func (UnimplementedHandler) AdminLogin(ctx context.Context, req *LoginRequest) (r AdminLoginRes, _ error)

AdminLogin implements adminLogin operation.

Admin user login.

POST /v1/admin/login

func (UnimplementedHandler) AdminLogout

func (UnimplementedHandler) AdminLogout(ctx context.Context) (r AdminLogoutRes, _ error)

AdminLogout implements adminLogout operation.

Logout current user (invalidate refresh token).

POST /v1/admin/logout

func (UnimplementedHandler) AdminUserCreate

AdminUserCreate implements adminUserCreate operation.

Create a new admin user.

POST /v1/admin/users/create

func (UnimplementedHandler) AdminUserDisable

AdminUserDisable implements adminUserDisable operation.

Disable an admin user.

POST /v1/admin/users/disable/{id}

func (UnimplementedHandler) AdminUserEnable

AdminUserEnable implements adminUserEnable operation.

Enable an admin user.

POST /v1/admin/users/enable/{id}

func (UnimplementedHandler) AdminUserGetById

AdminUserGetById implements adminUserGetById operation.

Get admin user by ID.

GET /v1/admin/users/get/{id}

func (UnimplementedHandler) AdminUserList

AdminUserList implements adminUserList operation.

List admin users with pagination.

GET /v1/admin/users/list

func (UnimplementedHandler) GetRoles

func (UnimplementedHandler) GetRoles(ctx context.Context) (r GetRolesRes, _ error)

GetRoles implements getRoles operation.

Get all available roles.

GET /v1/roles

func (UnimplementedHandler) TokenRefresh

TokenRefresh implements tokenRefresh operation.

Refresh access token using refresh token.

POST /v1/token/refresh

Jump to

Keyboard shortcuts

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