Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type AccessToken
- type Client
- func (c *Client) LogIn(ctx context.Context, request *Credentials) (LogInRes, error)
- func (c *Client) LogoutFromSession(ctx context.Context) (LogoutFromSessionRes, error)
- func (c *Client) RefreshAccessToken(ctx context.Context) (RefreshAccessTokenRes, error)
- func (c *Client) RefreshPair(ctx context.Context) (RefreshPairRes, error)
- type ClientOption
- type Credentials
- func (s *Credentials) Decode(d *jx.Decoder) error
- func (s *Credentials) Encode(e *jx.Encoder)
- func (s *Credentials) GetPassword() string
- func (s *Credentials) GetPhone() string
- func (s *Credentials) MarshalJSON() ([]byte, error)
- func (s *Credentials) SetPassword(val string)
- func (s *Credentials) SetPhone(val string)
- func (s *Credentials) UnmarshalJSON(data []byte) error
- type Error
- type ErrorHandler
- type Handler
- type Invoker
- type LogInBadRequest
- type LogInInternalServerError
- type LogInRes
- type LogoutFromSessionBadRequest
- type LogoutFromSessionInternalServerError
- func (s *LogoutFromSessionInternalServerError) Decode(d *jx.Decoder) error
- func (s *LogoutFromSessionInternalServerError) Encode(e *jx.Encoder)
- func (s *LogoutFromSessionInternalServerError) MarshalJSON() ([]byte, error)
- func (s *LogoutFromSessionInternalServerError) UnmarshalJSON(data []byte) error
- type LogoutFromSessionOK
- type LogoutFromSessionRes
- type Middleware
- type Option
- type RefreshAccessTokenBadRequest
- type RefreshAccessTokenInternalServerError
- func (s *RefreshAccessTokenInternalServerError) Decode(d *jx.Decoder) error
- func (s *RefreshAccessTokenInternalServerError) Encode(e *jx.Encoder)
- func (s *RefreshAccessTokenInternalServerError) MarshalJSON() ([]byte, error)
- func (s *RefreshAccessTokenInternalServerError) UnmarshalJSON(data []byte) error
- type RefreshAccessTokenRes
- type RefreshAuth
- type RefreshPairBadRequest
- type RefreshPairInternalServerError
- type RefreshPairRes
- type Route
- type SecurityHandler
- type SecuritySource
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type TokenPair
- func (s *TokenPair) Decode(d *jx.Decoder) error
- func (s *TokenPair) Encode(e *jx.Encoder)
- func (s *TokenPair) GetAccessToken() string
- func (s *TokenPair) GetRefreshToken() string
- func (s *TokenPair) MarshalJSON() ([]byte, error)
- func (s *TokenPair) SetAccessToken(val string)
- func (s *TokenPair) SetRefreshToken(val string)
- func (s *TokenPair) UnmarshalJSON(data []byte) error
- type UnimplementedHandler
- func (UnimplementedHandler) LogIn(ctx context.Context, req *Credentials) (r LogInRes, _ error)
- func (UnimplementedHandler) LogoutFromSession(ctx context.Context) (r LogoutFromSessionRes, _ error)
- func (UnimplementedHandler) RefreshAccessToken(ctx context.Context) (r RefreshAccessTokenRes, _ error)
- func (UnimplementedHandler) RefreshPair(ctx context.Context) (r RefreshPairRes, _ error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessToken ¶
type AccessToken struct {
AccessToken string `json:"accessToken"`
}
Ref: #/components/schemas/AccessToken
func (*AccessToken) Decode ¶
func (s *AccessToken) Decode(d *jx.Decoder) error
Decode decodes AccessToken from json.
func (*AccessToken) Encode ¶
func (s *AccessToken) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AccessToken) GetAccessToken ¶
func (s *AccessToken) GetAccessToken() string
GetAccessToken returns the value of AccessToken.
func (*AccessToken) MarshalJSON ¶
func (s *AccessToken) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AccessToken) SetAccessToken ¶
func (s *AccessToken) SetAccessToken(val string)
SetAccessToken sets the value of AccessToken.
func (*AccessToken) UnmarshalJSON ¶
func (s *AccessToken) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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) LogIn ¶
LogIn invokes LogIn operation.
Log into account and create a session.
POST /login
func (*Client) LogoutFromSession ¶
func (c *Client) LogoutFromSession(ctx context.Context) (LogoutFromSessionRes, error)
LogoutFromSession invokes LogoutFromSession operation.
Log out from the account using refresh token.
POST /logout
func (*Client) RefreshAccessToken ¶
func (c *Client) RefreshAccessToken(ctx context.Context) (RefreshAccessTokenRes, error)
RefreshAccessToken invokes RefreshAccessToken operation.
Create a new access token using refresh token.
POST /access
func (*Client) RefreshPair ¶
func (c *Client) RefreshPair(ctx context.Context) (RefreshPairRes, error)
RefreshPair invokes RefreshPair operation.
Refresh pair of tokens using refresh token.
POST /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 Credentials ¶
Ref: #/components/schemas/Credentials
func (*Credentials) Decode ¶
func (s *Credentials) Decode(d *jx.Decoder) error
Decode decodes Credentials from json.
func (*Credentials) Encode ¶
func (s *Credentials) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*Credentials) GetPassword ¶
func (s *Credentials) GetPassword() string
GetPassword returns the value of Password.
func (*Credentials) GetPhone ¶
func (s *Credentials) GetPhone() string
GetPhone returns the value of Phone.
func (*Credentials) MarshalJSON ¶
func (s *Credentials) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*Credentials) SetPassword ¶
func (s *Credentials) SetPassword(val string)
SetPassword sets the value of Password.
func (*Credentials) SetPhone ¶
func (s *Credentials) SetPhone(val string)
SetPhone sets the value of Phone.
func (*Credentials) UnmarshalJSON ¶
func (s *Credentials) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Error ¶
type Error struct {
Message string `json:"message"`
}
Ref: #/components/schemas/Error
func (*Error) GetMessage ¶
GetMessage returns the value of Message.
func (*Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) SetMessage ¶
SetMessage sets the value of Message.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Handler ¶
type Handler interface { // LogIn implements LogIn operation. // // Log into account and create a session. // // POST /login LogIn(ctx context.Context, req *Credentials) (LogInRes, error) // LogoutFromSession implements LogoutFromSession operation. // // Log out from the account using refresh token. // // POST /logout LogoutFromSession(ctx context.Context) (LogoutFromSessionRes, error) // RefreshAccessToken implements RefreshAccessToken operation. // // Create a new access token using refresh token. // // POST /access RefreshAccessToken(ctx context.Context) (RefreshAccessTokenRes, error) // RefreshPair implements RefreshPair operation. // // Refresh pair of tokens using refresh token. // // POST /refresh RefreshPair(ctx context.Context) (RefreshPairRes, error) }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // LogIn invokes LogIn operation. // // Log into account and create a session. // // POST /login LogIn(ctx context.Context, request *Credentials) (LogInRes, error) // LogoutFromSession invokes LogoutFromSession operation. // // Log out from the account using refresh token. // // POST /logout LogoutFromSession(ctx context.Context) (LogoutFromSessionRes, error) // RefreshAccessToken invokes RefreshAccessToken operation. // // Create a new access token using refresh token. // // POST /access RefreshAccessToken(ctx context.Context) (RefreshAccessTokenRes, error) // RefreshPair invokes RefreshPair operation. // // Refresh pair of tokens using refresh token. // // POST /refresh RefreshPair(ctx context.Context) (RefreshPairRes, error) }
Invoker invokes operations described by OpenAPI v3 specification.
type LogInBadRequest ¶
type LogInBadRequest Error
func (*LogInBadRequest) Decode ¶
func (s *LogInBadRequest) Decode(d *jx.Decoder) error
Decode decodes LogInBadRequest from json.
func (*LogInBadRequest) Encode ¶
func (s *LogInBadRequest) Encode(e *jx.Encoder)
Encode encodes LogInBadRequest as json.
func (*LogInBadRequest) MarshalJSON ¶
func (s *LogInBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*LogInBadRequest) UnmarshalJSON ¶
func (s *LogInBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type LogInInternalServerError ¶
type LogInInternalServerError Error
func (*LogInInternalServerError) Decode ¶
func (s *LogInInternalServerError) Decode(d *jx.Decoder) error
Decode decodes LogInInternalServerError from json.
func (*LogInInternalServerError) Encode ¶
func (s *LogInInternalServerError) Encode(e *jx.Encoder)
Encode encodes LogInInternalServerError as json.
func (*LogInInternalServerError) MarshalJSON ¶
func (s *LogInInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*LogInInternalServerError) UnmarshalJSON ¶
func (s *LogInInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type LogoutFromSessionBadRequest ¶
type LogoutFromSessionBadRequest Error
func (*LogoutFromSessionBadRequest) Decode ¶
func (s *LogoutFromSessionBadRequest) Decode(d *jx.Decoder) error
Decode decodes LogoutFromSessionBadRequest from json.
func (*LogoutFromSessionBadRequest) Encode ¶
func (s *LogoutFromSessionBadRequest) Encode(e *jx.Encoder)
Encode encodes LogoutFromSessionBadRequest as json.
func (*LogoutFromSessionBadRequest) MarshalJSON ¶
func (s *LogoutFromSessionBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*LogoutFromSessionBadRequest) UnmarshalJSON ¶
func (s *LogoutFromSessionBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type LogoutFromSessionInternalServerError ¶
type LogoutFromSessionInternalServerError Error
func (*LogoutFromSessionInternalServerError) Decode ¶
func (s *LogoutFromSessionInternalServerError) Decode(d *jx.Decoder) error
Decode decodes LogoutFromSessionInternalServerError from json.
func (*LogoutFromSessionInternalServerError) Encode ¶
func (s *LogoutFromSessionInternalServerError) Encode(e *jx.Encoder)
Encode encodes LogoutFromSessionInternalServerError as json.
func (*LogoutFromSessionInternalServerError) MarshalJSON ¶
func (s *LogoutFromSessionInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*LogoutFromSessionInternalServerError) UnmarshalJSON ¶
func (s *LogoutFromSessionInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type LogoutFromSessionOK ¶
type LogoutFromSessionOK struct{}
LogoutFromSessionOK is response for LogoutFromSession operation.
type LogoutFromSessionRes ¶
type LogoutFromSessionRes interface {
// contains filtered or unexported methods
}
type Option ¶
type Option interface { ServerOption ClientOption }
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 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 RefreshAccessTokenBadRequest ¶
type RefreshAccessTokenBadRequest Error
func (*RefreshAccessTokenBadRequest) Decode ¶
func (s *RefreshAccessTokenBadRequest) Decode(d *jx.Decoder) error
Decode decodes RefreshAccessTokenBadRequest from json.
func (*RefreshAccessTokenBadRequest) Encode ¶
func (s *RefreshAccessTokenBadRequest) Encode(e *jx.Encoder)
Encode encodes RefreshAccessTokenBadRequest as json.
func (*RefreshAccessTokenBadRequest) MarshalJSON ¶
func (s *RefreshAccessTokenBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RefreshAccessTokenBadRequest) UnmarshalJSON ¶
func (s *RefreshAccessTokenBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type RefreshAccessTokenInternalServerError ¶
type RefreshAccessTokenInternalServerError Error
func (*RefreshAccessTokenInternalServerError) Decode ¶
func (s *RefreshAccessTokenInternalServerError) Decode(d *jx.Decoder) error
Decode decodes RefreshAccessTokenInternalServerError from json.
func (*RefreshAccessTokenInternalServerError) Encode ¶
func (s *RefreshAccessTokenInternalServerError) Encode(e *jx.Encoder)
Encode encodes RefreshAccessTokenInternalServerError as json.
func (*RefreshAccessTokenInternalServerError) MarshalJSON ¶
func (s *RefreshAccessTokenInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RefreshAccessTokenInternalServerError) UnmarshalJSON ¶
func (s *RefreshAccessTokenInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type RefreshAccessTokenRes ¶
type RefreshAccessTokenRes interface {
// contains filtered or unexported methods
}
type RefreshAuth ¶
type RefreshAuth struct {
APIKey string
}
func (*RefreshAuth) GetAPIKey ¶
func (s *RefreshAuth) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*RefreshAuth) SetAPIKey ¶
func (s *RefreshAuth) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
type RefreshPairBadRequest ¶
type RefreshPairBadRequest Error
func (*RefreshPairBadRequest) Decode ¶
func (s *RefreshPairBadRequest) Decode(d *jx.Decoder) error
Decode decodes RefreshPairBadRequest from json.
func (*RefreshPairBadRequest) Encode ¶
func (s *RefreshPairBadRequest) Encode(e *jx.Encoder)
Encode encodes RefreshPairBadRequest as json.
func (*RefreshPairBadRequest) MarshalJSON ¶
func (s *RefreshPairBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RefreshPairBadRequest) UnmarshalJSON ¶
func (s *RefreshPairBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type RefreshPairInternalServerError ¶
type RefreshPairInternalServerError Error
func (*RefreshPairInternalServerError) Decode ¶
func (s *RefreshPairInternalServerError) Decode(d *jx.Decoder) error
Decode decodes RefreshPairInternalServerError from json.
func (*RefreshPairInternalServerError) Encode ¶
func (s *RefreshPairInternalServerError) Encode(e *jx.Encoder)
Encode encodes RefreshPairInternalServerError as json.
func (*RefreshPairInternalServerError) MarshalJSON ¶
func (s *RefreshPairInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RefreshPairInternalServerError) UnmarshalJSON ¶
func (s *RefreshPairInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type RefreshPairRes ¶
type RefreshPairRes interface {
// contains filtered or unexported methods
}
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface { // HandleRefreshAuth handles refreshAuth security. HandleRefreshAuth(ctx context.Context, operationName string, t RefreshAuth) (context.Context, error) }
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface { // RefreshAuth provides refreshAuth security value. RefreshAuth(ctx context.Context, operationName string) (RefreshAuth, 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.
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 TokenPair ¶
type TokenPair struct { AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` }
Ref: #/components/schemas/TokenPair
func (*TokenPair) GetAccessToken ¶
GetAccessToken returns the value of AccessToken.
func (*TokenPair) GetRefreshToken ¶
GetRefreshToken returns the value of RefreshToken.
func (*TokenPair) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TokenPair) SetAccessToken ¶
SetAccessToken sets the value of AccessToken.
func (*TokenPair) SetRefreshToken ¶
SetRefreshToken sets the value of RefreshToken.
func (*TokenPair) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) LogIn ¶
func (UnimplementedHandler) LogIn(ctx context.Context, req *Credentials) (r LogInRes, _ error)
LogIn implements LogIn operation.
Log into account and create a session.
POST /login
func (UnimplementedHandler) LogoutFromSession ¶
func (UnimplementedHandler) LogoutFromSession(ctx context.Context) (r LogoutFromSessionRes, _ error)
LogoutFromSession implements LogoutFromSession operation.
Log out from the account using refresh token.
POST /logout
func (UnimplementedHandler) RefreshAccessToken ¶
func (UnimplementedHandler) RefreshAccessToken(ctx context.Context) (r RefreshAccessTokenRes, _ error)
RefreshAccessToken implements RefreshAccessToken operation.
Create a new access token using refresh token.
POST /access
func (UnimplementedHandler) RefreshPair ¶
func (UnimplementedHandler) RefreshPair(ctx context.Context) (r RefreshPairRes, _ error)
RefreshPair implements RefreshPair operation.
Refresh pair of tokens using refresh token.
POST /refresh
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_middleware_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go