Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type AuthToken
- type BearerAuth
- type Booking
- func (s *Booking) Decode(d *jx.Decoder) error
- func (s *Booking) Encode(e *jx.Encoder)
- func (s *Booking) GetCreatedAt() OptDateTime
- func (s *Booking) GetEnd() OptDateTime
- func (s *Booking) GetID() OptInt64
- func (s *Booking) GetName() OptString
- func (s *Booking) GetStart() OptDateTime
- func (s *Booking) GetStatus() OptBookingStatus
- func (s *Booking) GetUpdatedAt() OptDateTime
- func (s *Booking) GetUser() OptInt64
- func (s *Booking) MarshalJSON() ([]byte, error)
- func (s *Booking) SetCreatedAt(val OptDateTime)
- func (s *Booking) SetEnd(val OptDateTime)
- func (s *Booking) SetID(val OptInt64)
- func (s *Booking) SetName(val OptString)
- func (s *Booking) SetStart(val OptDateTime)
- func (s *Booking) SetStatus(val OptBookingStatus)
- func (s *Booking) SetUpdatedAt(val OptDateTime)
- func (s *Booking) SetUser(val OptInt64)
- func (s *Booking) UnmarshalJSON(data []byte) error
- type BookingStatus
- func (s *BookingStatus) Decode(d *jx.Decoder) error
- func (s *BookingStatus) DecodeURI(d uri.Decoder) error
- func (s *BookingStatus) Encode(e *jx.Encoder)
- func (s *BookingStatus) EncodeURI(e uri.Encoder) error
- func (s *BookingStatus) GetStatus() OptString
- func (s *BookingStatus) MarshalJSON() ([]byte, error)
- func (s *BookingStatus) SetStatus(val OptString)
- func (s *BookingStatus) UnmarshalJSON(data []byte) error
- type BookingsBookingIDGetNotFound
- type BookingsBookingIDGetParams
- type BookingsBookingIDGetRes
- type BookingsBookingIDPutNotFound
- type BookingsBookingIDPutParams
- type BookingsBookingIDPutRes
- type BookingsGetParams
- type Client
- func (c *Client) BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (BookingsBookingIDGetRes, error)
- func (c *Client) BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (BookingsBookingIDPutRes, error)
- func (c *Client) BookingsGet(ctx context.Context, params BookingsGetParams) ([]Booking, error)
- func (c *Client) BookingsPost(ctx context.Context, request *NewBooking) (*Booking, error)
- func (c *Client) PingGet(ctx context.Context) (*PingGetOK, error)
- func (c *Client) UsersLoginPost(ctx context.Context, request *LoginUser) (UsersLoginPostRes, error)
- func (c *Client) UsersPost(ctx context.Context, request *NewUser) (*User, error)
- func (c *Client) UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (UsersUserIDDeleteRes, error)
- func (c *Client) UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (UsersUserIDGetRes, error)
- type ClientOption
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() int64
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val int64)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type Handler
- type Invoker
- type Labeler
- type LoginUser
- func (s *LoginUser) Decode(d *jx.Decoder) error
- func (s *LoginUser) Encode(e *jx.Encoder)
- func (s *LoginUser) GetEmail() OptString
- func (s *LoginUser) GetPassword() OptString
- func (s *LoginUser) MarshalJSON() ([]byte, error)
- func (s *LoginUser) SetEmail(val OptString)
- func (s *LoginUser) SetPassword(val OptString)
- func (s *LoginUser) UnmarshalJSON(data []byte) error
- type Middleware
- type NewBooking
- func (s *NewBooking) Decode(d *jx.Decoder) error
- func (s *NewBooking) Encode(e *jx.Encoder)
- func (s *NewBooking) GetEnd() OptDateTime
- func (s *NewBooking) GetName() OptString
- func (s *NewBooking) GetStart() OptDateTime
- func (s *NewBooking) GetUser() OptInt64
- func (s *NewBooking) MarshalJSON() ([]byte, error)
- func (s *NewBooking) SetEnd(val OptDateTime)
- func (s *NewBooking) SetName(val OptString)
- func (s *NewBooking) SetStart(val OptDateTime)
- func (s *NewBooking) SetUser(val OptInt64)
- func (s *NewBooking) UnmarshalJSON(data []byte) error
- type NewUser
- func (s *NewUser) Decode(d *jx.Decoder) error
- func (s *NewUser) Encode(e *jx.Encoder)
- func (s *NewUser) GetEmail() OptString
- func (s *NewUser) GetName() OptString
- func (s *NewUser) GetPassword() OptString
- func (s *NewUser) MarshalJSON() ([]byte, error)
- func (s *NewUser) SetEmail(val OptString)
- func (s *NewUser) SetName(val OptString)
- func (s *NewUser) SetPassword(val OptString)
- func (s *NewUser) UnmarshalJSON(data []byte) error
- type OptBookingStatus
- func (o *OptBookingStatus) Decode(d *jx.Decoder) error
- func (o OptBookingStatus) Encode(e *jx.Encoder)
- func (o OptBookingStatus) Get() (v BookingStatus, ok bool)
- func (o OptBookingStatus) IsSet() bool
- func (s OptBookingStatus) MarshalJSON() ([]byte, error)
- func (o OptBookingStatus) Or(d BookingStatus) BookingStatus
- func (o *OptBookingStatus) Reset()
- func (o *OptBookingStatus) SetTo(v BookingStatus)
- func (s *OptBookingStatus) UnmarshalJSON(data []byte) error
- type OptDateTime
- func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error
- func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))
- func (o OptDateTime) Get() (v time.Time, ok bool)
- func (o OptDateTime) IsSet() bool
- func (s OptDateTime) MarshalJSON() ([]byte, error)
- func (o OptDateTime) Or(d time.Time) time.Time
- func (o *OptDateTime) Reset()
- func (o *OptDateTime) SetTo(v time.Time)
- func (s *OptDateTime) UnmarshalJSON(data []byte) error
- type OptInt64
- func (o *OptInt64) Decode(d *jx.Decoder) error
- func (o OptInt64) Encode(e *jx.Encoder)
- func (o OptInt64) Get() (v int64, ok bool)
- func (o OptInt64) IsSet() bool
- func (s OptInt64) MarshalJSON() ([]byte, error)
- func (o OptInt64) Or(d int64) int64
- func (o *OptInt64) Reset()
- func (o *OptInt64) SetTo(v int64)
- func (s *OptInt64) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type PingGetOK
- 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 UnimplementedHandler
- func (UnimplementedHandler) BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (r BookingsBookingIDGetRes, _ error)
- func (UnimplementedHandler) BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (r BookingsBookingIDPutRes, _ error)
- func (UnimplementedHandler) BookingsGet(ctx context.Context, params BookingsGetParams) (r []Booking, _ error)
- func (UnimplementedHandler) BookingsPost(ctx context.Context, req *NewBooking) (r *Booking, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
- func (UnimplementedHandler) PingGet(ctx context.Context) (r *PingGetOK, _ error)
- func (UnimplementedHandler) UsersLoginPost(ctx context.Context, req *LoginUser) (r UsersLoginPostRes, _ error)
- func (UnimplementedHandler) UsersPost(ctx context.Context, req *NewUser) (r *User, _ error)
- func (UnimplementedHandler) UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (r UsersUserIDDeleteRes, _ error)
- func (UnimplementedHandler) UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (r UsersUserIDGetRes, _ error)
- type User
- func (s *User) Decode(d *jx.Decoder) error
- func (s *User) Encode(e *jx.Encoder)
- func (s *User) GetCreatedAt() OptDateTime
- func (s *User) GetEmail() OptString
- func (s *User) GetID() OptInt64
- func (s *User) GetName() OptString
- func (s *User) GetPassword() OptString
- func (s *User) GetUpdatedAt() OptDateTime
- func (s *User) MarshalJSON() ([]byte, error)
- func (s *User) SetCreatedAt(val OptDateTime)
- func (s *User) SetEmail(val OptString)
- func (s *User) SetID(val OptInt64)
- func (s *User) SetName(val OptString)
- func (s *User) SetPassword(val OptString)
- func (s *User) SetUpdatedAt(val OptDateTime)
- func (s *User) UnmarshalJSON(data []byte) error
- type UsersLoginPostRes
- type UsersLoginPostUnauthorized
- type UsersUserIDDeleteNoContent
- type UsersUserIDDeleteNotFound
- type UsersUserIDDeleteParams
- type UsersUserIDDeleteRes
- type UsersUserIDGetNotFound
- type UsersUserIDGetParams
- type UsersUserIDGetRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthToken ¶
type AuthToken struct { // Authentication token. Token OptString `json:"token"` }
Ref: #/components/schemas/AuthToken
func (*AuthToken) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*AuthToken) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type BearerAuth ¶
type BearerAuth struct {
Token string
}
func (*BearerAuth) GetToken ¶
func (s *BearerAuth) GetToken() string
GetToken returns the value of Token.
func (*BearerAuth) SetToken ¶
func (s *BearerAuth) SetToken(val string)
SetToken sets the value of Token.
type Booking ¶
type Booking struct { // Unique identifier for the booking. ID OptInt64 `json:"id"` // Name of the event. Name OptString `json:"name"` // Start date-time of the event. Start OptDateTime `json:"start"` // End date-time of the event. End OptDateTime `json:"end"` // User who made the booking. User OptInt64 `json:"user"` Status OptBookingStatus `json:"status"` // Date and time when the booking was created. CreatedAt OptDateTime `json:"created_at"` // Date and time when the booking was last updated. UpdatedAt OptDateTime `json:"updated_at"` }
Ref: #/components/schemas/Booking
func (*Booking) GetCreatedAt ¶
func (s *Booking) GetCreatedAt() OptDateTime
GetCreatedAt returns the value of CreatedAt.
func (*Booking) GetStart ¶
func (s *Booking) GetStart() OptDateTime
GetStart returns the value of Start.
func (*Booking) GetStatus ¶
func (s *Booking) GetStatus() OptBookingStatus
GetStatus returns the value of Status.
func (*Booking) GetUpdatedAt ¶
func (s *Booking) GetUpdatedAt() OptDateTime
GetUpdatedAt returns the value of UpdatedAt.
func (*Booking) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Booking) SetCreatedAt ¶
func (s *Booking) SetCreatedAt(val OptDateTime)
SetCreatedAt sets the value of CreatedAt.
func (*Booking) SetStart ¶
func (s *Booking) SetStart(val OptDateTime)
SetStart sets the value of Start.
func (*Booking) SetStatus ¶
func (s *Booking) SetStatus(val OptBookingStatus)
SetStatus sets the value of Status.
func (*Booking) SetUpdatedAt ¶
func (s *Booking) SetUpdatedAt(val OptDateTime)
SetUpdatedAt sets the value of UpdatedAt.
func (*Booking) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type BookingStatus ¶
type BookingStatus struct { // New status for the booking. Status OptString `json:"status"` }
Ref: #/components/schemas/BookingStatus
func (*BookingStatus) Decode ¶
func (s *BookingStatus) Decode(d *jx.Decoder) error
Decode decodes BookingStatus from json.
func (*BookingStatus) DecodeURI ¶
func (s *BookingStatus) DecodeURI(d uri.Decoder) error
DecodeURI decodes BookingStatus from URI form.
func (*BookingStatus) Encode ¶
func (s *BookingStatus) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*BookingStatus) EncodeURI ¶
func (s *BookingStatus) EncodeURI(e uri.Encoder) error
EncodeURI encodes BookingStatus as URI form.
func (*BookingStatus) GetStatus ¶
func (s *BookingStatus) GetStatus() OptString
GetStatus returns the value of Status.
func (*BookingStatus) MarshalJSON ¶
func (s *BookingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BookingStatus) SetStatus ¶
func (s *BookingStatus) SetStatus(val OptString)
SetStatus sets the value of Status.
func (*BookingStatus) UnmarshalJSON ¶
func (s *BookingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type BookingsBookingIDGetNotFound ¶
type BookingsBookingIDGetNotFound struct{}
BookingsBookingIDGetNotFound is response for BookingsBookingIDGet operation.
type BookingsBookingIDGetParams ¶
type BookingsBookingIDGetParams struct { // ID of the booking to retrieve. BookingID int64 }
BookingsBookingIDGetParams is parameters of GET /bookings/{bookingID} operation.
type BookingsBookingIDGetRes ¶
type BookingsBookingIDGetRes interface {
// contains filtered or unexported methods
}
type BookingsBookingIDPutNotFound ¶
type BookingsBookingIDPutNotFound struct{}
BookingsBookingIDPutNotFound is response for BookingsBookingIDPut operation.
type BookingsBookingIDPutParams ¶
type BookingsBookingIDPutParams struct { // ID of the booking to cancel. BookingID int64 }
BookingsBookingIDPutParams is parameters of PUT /bookings/{bookingID} operation.
type BookingsBookingIDPutRes ¶
type BookingsBookingIDPutRes interface {
// contains filtered or unexported methods
}
type BookingsGetParams ¶
type BookingsGetParams struct { // Filter bookings by status. Status OptBookingStatus // Filter bookings by user ID. User OptInt64 // Filter bookings by date. Start OptDateTime // Filter bookings by date. End OptDateTime }
BookingsGetParams is parameters of GET /bookings operation.
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) BookingsBookingIDGet ¶
func (c *Client) BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (BookingsBookingIDGetRes, error)
BookingsBookingIDGet invokes GET /bookings/{bookingID} operation.
Retrieve details of a specific booking by ID.
GET /bookings/{bookingID}
func (*Client) BookingsBookingIDPut ¶
func (c *Client) BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (BookingsBookingIDPutRes, error)
BookingsBookingIDPut invokes PUT /bookings/{bookingID} operation.
Cancel an existing booking.
PUT /bookings/{bookingID}
func (*Client) BookingsGet ¶
BookingsGet invokes GET /bookings operation.
Retrieve a list of all bookings that meets the conditions.
GET /bookings
func (*Client) BookingsPost ¶
BookingsPost invokes POST /bookings operation.
Create a new booking for a live event.
POST /bookings
func (*Client) PingGet ¶
PingGet invokes GET /ping operation.
Check if the server is running.
GET /ping
func (*Client) UsersLoginPost ¶
UsersLoginPost invokes POST /users/login operation.
Authenticate a user and generate a token.
POST /users/login
func (*Client) UsersPost ¶
UsersPost invokes POST /users operation.
Register a new user with the system.
POST /users
func (*Client) UsersUserIDDelete ¶
func (c *Client) UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (UsersUserIDDeleteRes, error)
UsersUserIDDelete invokes DELETE /users/{userID} operation.
Delete an existing user.
DELETE /users/{userID}
func (*Client) UsersUserIDGet ¶
func (c *Client) UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (UsersUserIDGetRes, error)
UsersUserIDGet invokes GET /users/{userID} operation.
Retrieve details of a specific user by ID.
GET /users/{userID}
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 Error ¶
Represents error object. 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 ErrorStatusCode ¶
ErrorStatusCode wraps Error with StatusCode.
func (*ErrorStatusCode) Error ¶
func (s *ErrorStatusCode) Error() string
func (*ErrorStatusCode) GetResponse ¶
func (s *ErrorStatusCode) GetResponse() Error
GetResponse returns the value of Response.
func (*ErrorStatusCode) GetStatusCode ¶
func (s *ErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*ErrorStatusCode) SetResponse ¶
func (s *ErrorStatusCode) SetResponse(val Error)
SetResponse sets the value of Response.
func (*ErrorStatusCode) SetStatusCode ¶
func (s *ErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type Handler ¶
type Handler interface { // BookingsBookingIDGet implements GET /bookings/{bookingID} operation. // // Retrieve details of a specific booking by ID. // // GET /bookings/{bookingID} BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (BookingsBookingIDGetRes, error) // BookingsBookingIDPut implements PUT /bookings/{bookingID} operation. // // Cancel an existing booking. // // PUT /bookings/{bookingID} BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (BookingsBookingIDPutRes, error) // BookingsGet implements GET /bookings operation. // // Retrieve a list of all bookings that meets the conditions. // // GET /bookings BookingsGet(ctx context.Context, params BookingsGetParams) ([]Booking, error) // BookingsPost implements POST /bookings operation. // // Create a new booking for a live event. // // POST /bookings BookingsPost(ctx context.Context, req *NewBooking) (*Booking, error) // PingGet implements GET /ping operation. // // Check if the server is running. // // GET /ping PingGet(ctx context.Context) (*PingGetOK, error) // UsersLoginPost implements POST /users/login operation. // // Authenticate a user and generate a token. // // POST /users/login UsersLoginPost(ctx context.Context, req *LoginUser) (UsersLoginPostRes, error) // UsersPost implements POST /users operation. // // Register a new user with the system. // // POST /users UsersPost(ctx context.Context, req *NewUser) (*User, error) // UsersUserIDDelete implements DELETE /users/{userID} operation. // // Delete an existing user. // // DELETE /users/{userID} UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (UsersUserIDDeleteRes, error) // UsersUserIDGet implements GET /users/{userID} operation. // // Retrieve details of a specific user by ID. // // GET /users/{userID} UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (UsersUserIDGetRes, error) // NewError creates *ErrorStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorStatusCode }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // BookingsBookingIDGet invokes GET /bookings/{bookingID} operation. // // Retrieve details of a specific booking by ID. // // GET /bookings/{bookingID} BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (BookingsBookingIDGetRes, error) // BookingsBookingIDPut invokes PUT /bookings/{bookingID} operation. // // Cancel an existing booking. // // PUT /bookings/{bookingID} BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (BookingsBookingIDPutRes, error) // BookingsGet invokes GET /bookings operation. // // Retrieve a list of all bookings that meets the conditions. // // GET /bookings BookingsGet(ctx context.Context, params BookingsGetParams) ([]Booking, error) // BookingsPost invokes POST /bookings operation. // // Create a new booking for a live event. // // POST /bookings BookingsPost(ctx context.Context, request *NewBooking) (*Booking, error) // PingGet invokes GET /ping operation. // // Check if the server is running. // // GET /ping PingGet(ctx context.Context) (*PingGetOK, error) // UsersLoginPost invokes POST /users/login operation. // // Authenticate a user and generate a token. // // POST /users/login UsersLoginPost(ctx context.Context, request *LoginUser) (UsersLoginPostRes, error) // UsersPost invokes POST /users operation. // // Register a new user with the system. // // POST /users UsersPost(ctx context.Context, request *NewUser) (*User, error) // UsersUserIDDelete invokes DELETE /users/{userID} operation. // // Delete an existing user. // // DELETE /users/{userID} UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (UsersUserIDDeleteRes, error) // UsersUserIDGet invokes GET /users/{userID} operation. // // Retrieve details of a specific user by ID. // // GET /users/{userID} UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (UsersUserIDGetRes, 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 ¶
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) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type LoginUser ¶
type LoginUser struct { // Email address of the user. Email OptString `json:"email"` // Password of the user. Password OptString `json:"password"` }
Ref: #/components/schemas/LoginUser
func (*LoginUser) GetPassword ¶
GetPassword returns the value of Password.
func (*LoginUser) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*LoginUser) SetPassword ¶
SetPassword sets the value of Password.
func (*LoginUser) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type NewBooking ¶
type NewBooking struct { // Name of the event. Name OptString `json:"name"` // Start date-time of the event. Start OptDateTime `json:"start"` // End date-time of the event. End OptDateTime `json:"end"` // User making the booking. User OptInt64 `json:"user"` }
Ref: #/components/schemas/NewBooking
func (*NewBooking) Decode ¶
func (s *NewBooking) Decode(d *jx.Decoder) error
Decode decodes NewBooking from json.
func (*NewBooking) Encode ¶
func (s *NewBooking) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*NewBooking) GetEnd ¶
func (s *NewBooking) GetEnd() OptDateTime
GetEnd returns the value of End.
func (*NewBooking) GetName ¶
func (s *NewBooking) GetName() OptString
GetName returns the value of Name.
func (*NewBooking) GetStart ¶
func (s *NewBooking) GetStart() OptDateTime
GetStart returns the value of Start.
func (*NewBooking) GetUser ¶
func (s *NewBooking) GetUser() OptInt64
GetUser returns the value of User.
func (*NewBooking) MarshalJSON ¶
func (s *NewBooking) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*NewBooking) SetEnd ¶
func (s *NewBooking) SetEnd(val OptDateTime)
SetEnd sets the value of End.
func (*NewBooking) SetName ¶
func (s *NewBooking) SetName(val OptString)
SetName sets the value of Name.
func (*NewBooking) SetStart ¶
func (s *NewBooking) SetStart(val OptDateTime)
SetStart sets the value of Start.
func (*NewBooking) SetUser ¶
func (s *NewBooking) SetUser(val OptInt64)
SetUser sets the value of User.
func (*NewBooking) UnmarshalJSON ¶
func (s *NewBooking) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type NewUser ¶
type NewUser struct { // Full name of the user. Name OptString `json:"name"` // Email address of the user. Email OptString `json:"email"` // Password of the user. Password OptString `json:"password"` }
Ref: #/components/schemas/NewUser
func (*NewUser) GetPassword ¶
GetPassword returns the value of Password.
func (*NewUser) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*NewUser) SetPassword ¶
SetPassword sets the value of Password.
func (*NewUser) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptBookingStatus ¶
type OptBookingStatus struct { Value BookingStatus Set bool }
OptBookingStatus is optional BookingStatus.
func NewOptBookingStatus ¶
func NewOptBookingStatus(v BookingStatus) OptBookingStatus
NewOptBookingStatus returns new OptBookingStatus with value set to v.
func (*OptBookingStatus) Decode ¶
func (o *OptBookingStatus) Decode(d *jx.Decoder) error
Decode decodes BookingStatus from json.
func (OptBookingStatus) Encode ¶
func (o OptBookingStatus) Encode(e *jx.Encoder)
Encode encodes BookingStatus as json.
func (OptBookingStatus) Get ¶
func (o OptBookingStatus) Get() (v BookingStatus, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptBookingStatus) IsSet ¶
func (o OptBookingStatus) IsSet() bool
IsSet returns true if OptBookingStatus was set.
func (OptBookingStatus) MarshalJSON ¶
func (s OptBookingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptBookingStatus) Or ¶
func (o OptBookingStatus) Or(d BookingStatus) BookingStatus
Or returns value if set, or given parameter if does not.
func (*OptBookingStatus) SetTo ¶
func (o *OptBookingStatus) SetTo(v BookingStatus)
SetTo sets value to v.
func (*OptBookingStatus) UnmarshalJSON ¶
func (s *OptBookingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptDateTime ¶
OptDateTime is optional time.Time.
func NewOptDateTime ¶
func NewOptDateTime(v time.Time) OptDateTime
NewOptDateTime returns new OptDateTime with value set to v.
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) UnmarshalJSON ¶
func (s *OptDateTime) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt64 ¶
OptInt64 is optional int64.
func NewOptInt64 ¶
NewOptInt64 returns new OptInt64 with value set to v.
func (OptInt64) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt64) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
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 PingGetOK ¶
type PingGetOK struct { // Response message. Message OptString `json:"message"` }
func (*PingGetOK) GetMessage ¶
GetMessage returns the value of Message.
func (*PingGetOK) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*PingGetOK) SetMessage ¶
SetMessage sets the value of Message.
func (*PingGetOK) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
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 { // HandleBearerAuth handles BearerAuth security. HandleBearerAuth(ctx context.Context, operationName string, t BearerAuth) (context.Context, error) }
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface { // BearerAuth provides BearerAuth security value. BearerAuth(ctx context.Context, operationName string) (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.
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 UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) BookingsBookingIDGet ¶
func (UnimplementedHandler) BookingsBookingIDGet(ctx context.Context, params BookingsBookingIDGetParams) (r BookingsBookingIDGetRes, _ error)
BookingsBookingIDGet implements GET /bookings/{bookingID} operation.
Retrieve details of a specific booking by ID.
GET /bookings/{bookingID}
func (UnimplementedHandler) BookingsBookingIDPut ¶
func (UnimplementedHandler) BookingsBookingIDPut(ctx context.Context, params BookingsBookingIDPutParams) (r BookingsBookingIDPutRes, _ error)
BookingsBookingIDPut implements PUT /bookings/{bookingID} operation.
Cancel an existing booking.
PUT /bookings/{bookingID}
func (UnimplementedHandler) BookingsGet ¶
func (UnimplementedHandler) BookingsGet(ctx context.Context, params BookingsGetParams) (r []Booking, _ error)
BookingsGet implements GET /bookings operation.
Retrieve a list of all bookings that meets the conditions.
GET /bookings
func (UnimplementedHandler) BookingsPost ¶
func (UnimplementedHandler) BookingsPost(ctx context.Context, req *NewBooking) (r *Booking, _ error)
BookingsPost implements POST /bookings operation.
Create a new booking for a live event.
POST /bookings
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
NewError creates *ErrorStatusCode from error returned by handler.
Used for common default response.
func (UnimplementedHandler) PingGet ¶
func (UnimplementedHandler) PingGet(ctx context.Context) (r *PingGetOK, _ error)
PingGet implements GET /ping operation.
Check if the server is running.
GET /ping
func (UnimplementedHandler) UsersLoginPost ¶
func (UnimplementedHandler) UsersLoginPost(ctx context.Context, req *LoginUser) (r UsersLoginPostRes, _ error)
UsersLoginPost implements POST /users/login operation.
Authenticate a user and generate a token.
POST /users/login
func (UnimplementedHandler) UsersPost ¶
UsersPost implements POST /users operation.
Register a new user with the system.
POST /users
func (UnimplementedHandler) UsersUserIDDelete ¶
func (UnimplementedHandler) UsersUserIDDelete(ctx context.Context, params UsersUserIDDeleteParams) (r UsersUserIDDeleteRes, _ error)
UsersUserIDDelete implements DELETE /users/{userID} operation.
Delete an existing user.
DELETE /users/{userID}
func (UnimplementedHandler) UsersUserIDGet ¶
func (UnimplementedHandler) UsersUserIDGet(ctx context.Context, params UsersUserIDGetParams) (r UsersUserIDGetRes, _ error)
UsersUserIDGet implements GET /users/{userID} operation.
Retrieve details of a specific user by ID.
GET /users/{userID}
type User ¶
type User struct { // Unique identifier for the user. ID OptInt64 `json:"id"` // Full name of the user. Name OptString `json:"name"` // Email address of the user. Email OptString `json:"email"` // Password of the user (hashed). Password OptString `json:"password"` // Date and time when the user was created. CreatedAt OptDateTime `json:"created_at"` // Date and time when the user was last updated. UpdatedAt OptDateTime `json:"updated_at"` }
Ref: #/components/schemas/User
func (*User) GetCreatedAt ¶
func (s *User) GetCreatedAt() OptDateTime
GetCreatedAt returns the value of CreatedAt.
func (*User) GetPassword ¶
GetPassword returns the value of Password.
func (*User) GetUpdatedAt ¶
func (s *User) GetUpdatedAt() OptDateTime
GetUpdatedAt returns the value of UpdatedAt.
func (*User) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*User) SetCreatedAt ¶
func (s *User) SetCreatedAt(val OptDateTime)
SetCreatedAt sets the value of CreatedAt.
func (*User) SetPassword ¶
SetPassword sets the value of Password.
func (*User) SetUpdatedAt ¶
func (s *User) SetUpdatedAt(val OptDateTime)
SetUpdatedAt sets the value of UpdatedAt.
func (*User) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type UsersLoginPostRes ¶
type UsersLoginPostRes interface {
// contains filtered or unexported methods
}
type UsersLoginPostUnauthorized ¶
type UsersLoginPostUnauthorized struct{}
UsersLoginPostUnauthorized is response for UsersLoginPost operation.
type UsersUserIDDeleteNoContent ¶
type UsersUserIDDeleteNoContent struct{}
UsersUserIDDeleteNoContent is response for UsersUserIDDelete operation.
type UsersUserIDDeleteNotFound ¶
type UsersUserIDDeleteNotFound struct{}
UsersUserIDDeleteNotFound is response for UsersUserIDDelete operation.
type UsersUserIDDeleteParams ¶
type UsersUserIDDeleteParams struct { // ID of the user to delete. UserID int64 }
UsersUserIDDeleteParams is parameters of DELETE /users/{userID} operation.
type UsersUserIDDeleteRes ¶
type UsersUserIDDeleteRes interface {
// contains filtered or unexported methods
}
type UsersUserIDGetNotFound ¶
type UsersUserIDGetNotFound struct{}
UsersUserIDGetNotFound is response for UsersUserIDGet operation.
type UsersUserIDGetParams ¶
type UsersUserIDGetParams struct { // ID of the user to retrieve. UserID int64 }
UsersUserIDGetParams is parameters of GET /users/{userID} operation.
type UsersUserIDGetRes ¶
type UsersUserIDGetRes interface {
// contains filtered or unexported methods
}
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_parameters_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
- oas_uri_gen.go