Documentation
¶
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Bird
- func (s *Bird) Decode(d *jx.Decoder) error
- func (s *Bird) Encode(e *jx.Encoder)
- func (s *Bird) GetCanTalk() OptBool
- func (s *Bird) GetName() string
- func (s *Bird) GetPetType() string
- func (s *Bird) GetSpecies() string
- func (s *Bird) MarshalJSON() ([]byte, error)
- func (s *Bird) SetCanTalk(val OptBool)
- func (s *Bird) SetName(val string)
- func (s *Bird) SetPetType(val string)
- func (s *Bird) SetSpecies(val string)
- func (s *Bird) UnmarshalJSON(data []byte) error
- type Car
- func (s *Car) Decode(d *jx.Decoder) error
- func (s *Car) Encode(e *jx.Encoder)
- func (s *Car) GetDoors() OptInt
- func (s *Car) GetMake() string
- func (s *Car) GetModel() string
- func (s *Car) GetVehicleType() string
- func (s *Car) MarshalJSON() ([]byte, error)
- func (s *Car) SetDoors(val OptInt)
- func (s *Car) SetMake(val string)
- func (s *Car) SetModel(val string)
- func (s *Car) SetVehicleType(val string)
- func (s *Car) UnmarshalJSON(data []byte) error
- func (s *Car) Validate() error
- type Cat
- func (s *Cat) Decode(d *jx.Decoder) error
- func (s *Cat) Encode(e *jx.Encoder)
- func (s *Cat) GetBreed() string
- func (s *Cat) GetMeowVolume() OptInt
- func (s *Cat) GetName() string
- func (s *Cat) GetPetType() string
- func (s *Cat) MarshalJSON() ([]byte, error)
- func (s *Cat) SetBreed(val string)
- func (s *Cat) SetMeowVolume(val OptInt)
- func (s *Cat) SetName(val string)
- func (s *Cat) SetPetType(val string)
- func (s *Cat) UnmarshalJSON(data []byte) error
- func (s *Cat) Validate() error
- type Client
- type ClientOption
- type Dog
- func (s *Dog) Decode(d *jx.Decoder) error
- func (s *Dog) Encode(e *jx.Encoder)
- func (s *Dog) GetBarkLoudness() OptInt
- func (s *Dog) GetBreed() string
- func (s *Dog) GetName() string
- func (s *Dog) GetPetType() string
- func (s *Dog) MarshalJSON() ([]byte, error)
- func (s *Dog) SetBarkLoudness(val OptInt)
- func (s *Dog) SetBreed(val string)
- func (s *Dog) SetName(val string)
- func (s *Dog) SetPetType(val string)
- func (s *Dog) UnmarshalJSON(data []byte) error
- func (s *Dog) Validate() error
- type EmailNotification
- func (s *EmailNotification) Decode(d *jx.Decoder) error
- func (s *EmailNotification) Encode(e *jx.Encoder)
- func (s *EmailNotification) GetBody() OptString
- func (s *EmailNotification) GetNotificationType() string
- func (s *EmailNotification) GetRecipient() string
- func (s *EmailNotification) GetSubject() string
- func (s *EmailNotification) MarshalJSON() ([]byte, error)
- func (s *EmailNotification) SetBody(val OptString)
- func (s *EmailNotification) SetNotificationType(val string)
- func (s *EmailNotification) SetRecipient(val string)
- func (s *EmailNotification) SetSubject(val string)
- func (s *EmailNotification) UnmarshalJSON(data []byte) error
- func (s *EmailNotification) Validate() error
- type ErrorHandler
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type Motorcycle
- func (s *Motorcycle) Decode(d *jx.Decoder) error
- func (s *Motorcycle) Encode(e *jx.Encoder)
- func (s *Motorcycle) GetEngineSize() OptFloat64
- func (s *Motorcycle) GetMake() string
- func (s *Motorcycle) GetModel() string
- func (s *Motorcycle) GetVehicleType() string
- func (s *Motorcycle) MarshalJSON() ([]byte, error)
- func (s *Motorcycle) SetEngineSize(val OptFloat64)
- func (s *Motorcycle) SetMake(val string)
- func (s *Motorcycle) SetModel(val string)
- func (s *Motorcycle) SetVehicleType(val string)
- func (s *Motorcycle) UnmarshalJSON(data []byte) error
- func (s *Motorcycle) Validate() error
- type Notification
- func NewNotificationEmailNotification(v EmailNotification) Notification
- func NewNotificationMailNotification(v EmailNotification) Notification
- func NewNotificationMobileNotification(v PushNotification) Notification
- func NewNotificationPushNotification(v PushNotification) Notification
- func NewNotificationSMSNotification(v SMSNotification) Notification
- func NewNotificationTextNotification(v SMSNotification) Notification
- func (s *Notification) Decode(d *jx.Decoder) error
- func (s Notification) Encode(e *jx.Encoder)
- func (s Notification) GetEmailNotification() (v EmailNotification, ok bool)
- func (s Notification) GetPushNotification() (v PushNotification, ok bool)
- func (s Notification) GetSMSNotification() (v SMSNotification, ok bool)
- func (s Notification) IsEmailNotification() bool
- func (s Notification) IsPushNotification() bool
- func (s Notification) IsSMSNotification() bool
- func (s Notification) MarshalJSON() ([]byte, error)
- func (s *Notification) SetEmailNotification(t NotificationType, v EmailNotification)
- func (s *Notification) SetPushNotification(t NotificationType, v PushNotification)
- func (s *Notification) SetSMSNotification(t NotificationType, v SMSNotification)
- func (s *Notification) UnmarshalJSON(data []byte) error
- func (s Notification) Validate() error
- type NotificationType
- type OperationName
- type OptBool
- func (o *OptBool) Decode(d *jx.Decoder) error
- func (o OptBool) Encode(e *jx.Encoder)
- func (o OptBool) Get() (v bool, ok bool)
- func (o OptBool) IsSet() bool
- func (s OptBool) MarshalJSON() ([]byte, error)
- func (o OptBool) Or(d bool) bool
- func (o *OptBool) Reset()
- func (o *OptBool) SetTo(v bool)
- func (s *OptBool) UnmarshalJSON(data []byte) error
- type OptFloat64
- func (o *OptFloat64) Decode(d *jx.Decoder) error
- func (o OptFloat64) Encode(e *jx.Encoder)
- func (o OptFloat64) Get() (v float64, ok bool)
- func (o OptFloat64) IsSet() bool
- func (s OptFloat64) MarshalJSON() ([]byte, error)
- func (o OptFloat64) Or(d float64) float64
- func (o *OptFloat64) Reset()
- func (o *OptFloat64) SetTo(v float64)
- func (s *OptFloat64) UnmarshalJSON(data []byte) error
- type OptInt
- func (o *OptInt) Decode(d *jx.Decoder) error
- func (o OptInt) Encode(e *jx.Encoder)
- func (o OptInt) Get() (v int, ok bool)
- func (o OptInt) IsSet() bool
- func (s OptInt) MarshalJSON() ([]byte, error)
- func (o OptInt) Or(d int) int
- func (o *OptInt) Reset()
- func (o *OptInt) SetTo(v int)
- func (s *OptInt) 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 Pet
- func (s *Pet) Decode(d *jx.Decoder) error
- func (s Pet) Encode(e *jx.Encoder)
- func (s Pet) GetBird() (v Bird, ok bool)
- func (s Pet) GetCat() (v Cat, ok bool)
- func (s Pet) GetDog() (v Dog, ok bool)
- func (s Pet) IsBird() bool
- func (s Pet) IsCat() bool
- func (s Pet) IsDog() bool
- func (s Pet) MarshalJSON() ([]byte, error)
- func (s *Pet) SetBird(t PetType, v Bird)
- func (s *Pet) SetCat(t PetType, v Cat)
- func (s *Pet) SetDog(t PetType, v Dog)
- func (s *Pet) UnmarshalJSON(data []byte) error
- func (s Pet) Validate() error
- type PetType
- type PushNotification
- func (s *PushNotification) Decode(d *jx.Decoder) error
- func (s *PushNotification) Encode(e *jx.Encoder)
- func (s *PushNotification) GetBadge() OptInt
- func (s *PushNotification) GetBody() OptString
- func (s *PushNotification) GetDeviceId() string
- func (s *PushNotification) GetNotificationType() string
- func (s *PushNotification) GetTitle() string
- func (s *PushNotification) MarshalJSON() ([]byte, error)
- func (s *PushNotification) SetBadge(val OptInt)
- func (s *PushNotification) SetBody(val OptString)
- func (s *PushNotification) SetDeviceId(val string)
- func (s *PushNotification) SetNotificationType(val string)
- func (s *PushNotification) SetTitle(val string)
- func (s *PushNotification) UnmarshalJSON(data []byte) error
- func (s *PushNotification) Validate() error
- type Route
- type SMSNotification
- func (s *SMSNotification) Decode(d *jx.Decoder) error
- func (s *SMSNotification) Encode(e *jx.Encoder)
- func (s *SMSNotification) GetMessage() string
- func (s *SMSNotification) GetNotificationType() string
- func (s *SMSNotification) GetPhoneNumber() string
- func (s *SMSNotification) MarshalJSON() ([]byte, error)
- func (s *SMSNotification) SetMessage(val string)
- func (s *SMSNotification) SetNotificationType(val string)
- func (s *SMSNotification) SetPhoneNumber(val string)
- func (s *SMSNotification) UnmarshalJSON(data []byte) error
- func (s *SMSNotification) Validate() error
- 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) CreatePet(ctx context.Context, req Pet) (r Pet, _ error)
- func (UnimplementedHandler) ListNotifications(ctx context.Context) (r []Notification, _ error)
- func (UnimplementedHandler) ListPets(ctx context.Context) (r []Pet, _ error)
- func (UnimplementedHandler) ListVehicles(ctx context.Context) (r []Vehicle, _ error)
- type Vehicle
- func (s *Vehicle) Decode(d *jx.Decoder) error
- func (s Vehicle) Encode(e *jx.Encoder)
- func (s Vehicle) GetCar() (v Car, ok bool)
- func (s Vehicle) GetMotorcycle() (v Motorcycle, ok bool)
- func (s Vehicle) IsCar() bool
- func (s Vehicle) IsMotorcycle() bool
- func (s Vehicle) MarshalJSON() ([]byte, error)
- func (s *Vehicle) SetCar(v Car)
- func (s *Vehicle) SetMotorcycle(v Motorcycle)
- func (s *Vehicle) UnmarshalJSON(data []byte) error
- func (s Vehicle) Validate() error
- type VehicleType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bird ¶
type Bird struct {
PetType string `json:"petType"`
Name string `json:"name"`
Species string `json:"species"`
CanTalk OptBool `json:"canTalk"`
}
Ref: #/components/schemas/Bird
func (*Bird) GetCanTalk ¶
GetCanTalk returns the value of CanTalk.
func (*Bird) GetPetType ¶
GetPetType returns the value of PetType.
func (*Bird) GetSpecies ¶
GetSpecies returns the value of Species.
func (*Bird) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Bird) SetCanTalk ¶
SetCanTalk sets the value of CanTalk.
func (*Bird) SetPetType ¶
SetPetType sets the value of PetType.
func (*Bird) SetSpecies ¶
SetSpecies sets the value of Species.
func (*Bird) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Car ¶
type Car struct {
VehicleType string `json:"vehicleType"`
Make string `json:"make"`
Model string `json:"model"`
Doors OptInt `json:"doors"`
}
Ref: #/components/schemas/Car
func (*Car) GetVehicleType ¶
GetVehicleType returns the value of VehicleType.
func (*Car) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Car) SetVehicleType ¶
SetVehicleType sets the value of VehicleType.
func (*Car) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Cat ¶
type Cat struct {
PetType string `json:"petType"`
Name string `json:"name"`
Breed string `json:"breed"`
MeowVolume OptInt `json:"meowVolume"`
}
Ref: #/components/schemas/Cat
func (*Cat) GetMeowVolume ¶
GetMeowVolume returns the value of MeowVolume.
func (*Cat) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Cat) SetMeowVolume ¶
SetMeowVolume sets the value of MeowVolume.
func (*Cat) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(ctx context.Context) ([]Notification, error)
ListNotifications invokes listNotifications operation.
List notifications.
GET /notifications
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 Dog ¶
type Dog struct {
PetType string `json:"petType"`
Name string `json:"name"`
Breed string `json:"breed"`
BarkLoudness OptInt `json:"barkLoudness"`
}
Ref: #/components/schemas/Dog
func (*Dog) GetBarkLoudness ¶
GetBarkLoudness returns the value of BarkLoudness.
func (*Dog) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Dog) SetBarkLoudness ¶
SetBarkLoudness sets the value of BarkLoudness.
func (*Dog) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type EmailNotification ¶
type EmailNotification struct {
NotificationType string `json:"notificationType"`
Recipient string `json:"recipient"`
Subject string `json:"subject"`
Body OptString `json:"body"`
}
Ref: #/components/schemas/EmailNotification
func (*EmailNotification) Decode ¶
func (s *EmailNotification) Decode(d *jx.Decoder) error
Decode decodes EmailNotification from json.
func (*EmailNotification) Encode ¶
func (s *EmailNotification) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*EmailNotification) GetBody ¶
func (s *EmailNotification) GetBody() OptString
GetBody returns the value of Body.
func (*EmailNotification) GetNotificationType ¶
func (s *EmailNotification) GetNotificationType() string
GetNotificationType returns the value of NotificationType.
func (*EmailNotification) GetRecipient ¶
func (s *EmailNotification) GetRecipient() string
GetRecipient returns the value of Recipient.
func (*EmailNotification) GetSubject ¶
func (s *EmailNotification) GetSubject() string
GetSubject returns the value of Subject.
func (*EmailNotification) MarshalJSON ¶
func (s *EmailNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*EmailNotification) SetBody ¶
func (s *EmailNotification) SetBody(val OptString)
SetBody sets the value of Body.
func (*EmailNotification) SetNotificationType ¶
func (s *EmailNotification) SetNotificationType(val string)
SetNotificationType sets the value of NotificationType.
func (*EmailNotification) SetRecipient ¶
func (s *EmailNotification) SetRecipient(val string)
SetRecipient sets the value of Recipient.
func (*EmailNotification) SetSubject ¶
func (s *EmailNotification) SetSubject(val string)
SetSubject sets the value of Subject.
func (*EmailNotification) UnmarshalJSON ¶
func (s *EmailNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*EmailNotification) Validate ¶
func (s *EmailNotification) Validate() error
type Handler ¶
type Handler interface {
// CreatePet implements createPet operation.
//
// Create a pet.
//
// POST /pets
CreatePet(ctx context.Context, req Pet) (Pet, error)
// ListNotifications implements listNotifications operation.
//
// List notifications.
//
// GET /notifications
ListNotifications(ctx context.Context) ([]Notification, error)
// ListPets implements listPets operation.
//
// List pets.
//
// GET /pets
ListPets(ctx context.Context) ([]Pet, error)
// ListVehicles implements listVehicles operation.
//
// List vehicles.
//
// GET /vehicles
ListVehicles(ctx context.Context) ([]Vehicle, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// CreatePet invokes createPet operation.
//
// Create a pet.
//
// POST /pets
CreatePet(ctx context.Context, request Pet) (Pet, error)
// ListNotifications invokes listNotifications operation.
//
// List notifications.
//
// GET /notifications
ListNotifications(ctx context.Context) ([]Notification, error)
// ListPets invokes listPets operation.
//
// List pets.
//
// GET /pets
ListPets(ctx context.Context) ([]Pet, error)
// ListVehicles invokes listVehicles operation.
//
// List vehicles.
//
// GET /vehicles
ListVehicles(ctx context.Context) ([]Vehicle, 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 Motorcycle ¶
type Motorcycle struct {
VehicleType string `json:"vehicleType"`
Make string `json:"make"`
Model string `json:"model"`
EngineSize OptFloat64 `json:"engineSize"`
}
Ref: #/components/schemas/Motorcycle
func (*Motorcycle) Decode ¶
func (s *Motorcycle) Decode(d *jx.Decoder) error
Decode decodes Motorcycle from json.
func (*Motorcycle) Encode ¶
func (s *Motorcycle) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*Motorcycle) GetEngineSize ¶
func (s *Motorcycle) GetEngineSize() OptFloat64
GetEngineSize returns the value of EngineSize.
func (*Motorcycle) GetMake ¶
func (s *Motorcycle) GetMake() string
GetMake returns the value of Make.
func (*Motorcycle) GetModel ¶
func (s *Motorcycle) GetModel() string
GetModel returns the value of Model.
func (*Motorcycle) GetVehicleType ¶
func (s *Motorcycle) GetVehicleType() string
GetVehicleType returns the value of VehicleType.
func (*Motorcycle) MarshalJSON ¶
func (s *Motorcycle) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*Motorcycle) SetEngineSize ¶
func (s *Motorcycle) SetEngineSize(val OptFloat64)
SetEngineSize sets the value of EngineSize.
func (*Motorcycle) SetMake ¶
func (s *Motorcycle) SetMake(val string)
SetMake sets the value of Make.
func (*Motorcycle) SetModel ¶
func (s *Motorcycle) SetModel(val string)
SetModel sets the value of Model.
func (*Motorcycle) SetVehicleType ¶
func (s *Motorcycle) SetVehicleType(val string)
SetVehicleType sets the value of VehicleType.
func (*Motorcycle) UnmarshalJSON ¶
func (s *Motorcycle) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Motorcycle) Validate ¶
func (s *Motorcycle) Validate() error
type Notification ¶
type Notification struct {
Type NotificationType // switch on this field
EmailNotification EmailNotification
SMSNotification SMSNotification
PushNotification PushNotification
}
Ref: #/components/schemas/Notification Notification represents sum type.
func NewNotificationEmailNotification ¶
func NewNotificationEmailNotification(v EmailNotification) Notification
NewNotificationEmailNotification returns new Notification from EmailNotification.
func NewNotificationMailNotification ¶
func NewNotificationMailNotification(v EmailNotification) Notification
NewNotificationMailNotification returns new Notification from EmailNotification.
func NewNotificationMobileNotification ¶
func NewNotificationMobileNotification(v PushNotification) Notification
NewNotificationMobileNotification returns new Notification from PushNotification.
func NewNotificationPushNotification ¶
func NewNotificationPushNotification(v PushNotification) Notification
NewNotificationPushNotification returns new Notification from PushNotification.
func NewNotificationSMSNotification ¶
func NewNotificationSMSNotification(v SMSNotification) Notification
NewNotificationSMSNotification returns new Notification from SMSNotification.
func NewNotificationTextNotification ¶
func NewNotificationTextNotification(v SMSNotification) Notification
NewNotificationTextNotification returns new Notification from SMSNotification.
func (*Notification) Decode ¶
func (s *Notification) Decode(d *jx.Decoder) error
Decode decodes Notification from json.
func (Notification) Encode ¶
func (s Notification) Encode(e *jx.Encoder)
Encode encodes Notification as json.
func (Notification) GetEmailNotification ¶
func (s Notification) GetEmailNotification() (v EmailNotification, ok bool)
GetEmailNotification returns EmailNotification and true boolean if Notification is EmailNotification.
func (Notification) GetPushNotification ¶
func (s Notification) GetPushNotification() (v PushNotification, ok bool)
GetPushNotification returns PushNotification and true boolean if Notification is PushNotification.
func (Notification) GetSMSNotification ¶
func (s Notification) GetSMSNotification() (v SMSNotification, ok bool)
GetSMSNotification returns SMSNotification and true boolean if Notification is SMSNotification.
func (Notification) IsEmailNotification ¶
func (s Notification) IsEmailNotification() bool
IsEmailNotification reports whether Notification is EmailNotification.
func (Notification) IsPushNotification ¶
func (s Notification) IsPushNotification() bool
IsPushNotification reports whether Notification is PushNotification.
func (Notification) IsSMSNotification ¶
func (s Notification) IsSMSNotification() bool
IsSMSNotification reports whether Notification is SMSNotification.
func (Notification) MarshalJSON ¶
func (s Notification) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*Notification) SetEmailNotification ¶
func (s *Notification) SetEmailNotification(t NotificationType, v EmailNotification)
SetEmailNotification sets Notification to EmailNotification. panics if `t` is not associated with EmailNotification
func (*Notification) SetPushNotification ¶
func (s *Notification) SetPushNotification(t NotificationType, v PushNotification)
SetPushNotification sets Notification to PushNotification. panics if `t` is not associated with PushNotification
func (*Notification) SetSMSNotification ¶
func (s *Notification) SetSMSNotification(t NotificationType, v SMSNotification)
SetSMSNotification sets Notification to SMSNotification. panics if `t` is not associated with SMSNotification
func (*Notification) UnmarshalJSON ¶
func (s *Notification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (Notification) Validate ¶
func (s Notification) Validate() error
type NotificationType ¶
type NotificationType string
NotificationType is oneOf type of Notification.
const ( NotificationEmailNotification NotificationType = "email" NotificationMailNotification NotificationType = "mail" NotificationSMSNotification NotificationType = "sms" NotificationTextNotification NotificationType = "text" NotificationMobileNotification NotificationType = "mobile" NotificationPushNotification NotificationType = "push" )
Possible values for NotificationType.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( CreatePetOperation OperationName = "CreatePet" ListNotificationsOperation OperationName = "ListNotifications" ListPetsOperation OperationName = "ListPets" ListVehiclesOperation OperationName = "ListVehicles" )
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
func (OptBool) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptBool) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptFloat64 ¶
OptFloat64 is optional float64.
func NewOptFloat64 ¶
func NewOptFloat64(v float64) OptFloat64
NewOptFloat64 returns new OptFloat64 with value set to v.
func (*OptFloat64) Decode ¶
func (o *OptFloat64) Decode(d *jx.Decoder) error
Decode decodes float64 from json.
func (OptFloat64) Encode ¶
func (o OptFloat64) Encode(e *jx.Encoder)
Encode encodes float64 as json.
func (OptFloat64) Get ¶
func (o OptFloat64) Get() (v float64, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptFloat64) IsSet ¶
func (o OptFloat64) IsSet() bool
IsSet returns true if OptFloat64 was set.
func (OptFloat64) MarshalJSON ¶
func (s OptFloat64) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptFloat64) Or ¶
func (o OptFloat64) Or(d float64) float64
Or returns value if set, or given parameter if does not.
func (*OptFloat64) UnmarshalJSON ¶
func (s *OptFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) 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 WithAttributes ¶ added in v1.15.0
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 Pet ¶
Ref: #/components/schemas/Pet Pet represents sum type.
func (Pet) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Pet) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PushNotification ¶
type PushNotification struct {
NotificationType string `json:"notificationType"`
DeviceId string `json:"deviceId"`
Title string `json:"title"`
Body OptString `json:"body"`
Badge OptInt `json:"badge"`
}
Ref: #/components/schemas/PushNotification
func (*PushNotification) Decode ¶
func (s *PushNotification) Decode(d *jx.Decoder) error
Decode decodes PushNotification from json.
func (*PushNotification) Encode ¶
func (s *PushNotification) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PushNotification) GetBadge ¶
func (s *PushNotification) GetBadge() OptInt
GetBadge returns the value of Badge.
func (*PushNotification) GetBody ¶
func (s *PushNotification) GetBody() OptString
GetBody returns the value of Body.
func (*PushNotification) GetDeviceId ¶
func (s *PushNotification) GetDeviceId() string
GetDeviceId returns the value of DeviceId.
func (*PushNotification) GetNotificationType ¶
func (s *PushNotification) GetNotificationType() string
GetNotificationType returns the value of NotificationType.
func (*PushNotification) GetTitle ¶
func (s *PushNotification) GetTitle() string
GetTitle returns the value of Title.
func (*PushNotification) MarshalJSON ¶
func (s *PushNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PushNotification) SetBadge ¶
func (s *PushNotification) SetBadge(val OptInt)
SetBadge sets the value of Badge.
func (*PushNotification) SetBody ¶
func (s *PushNotification) SetBody(val OptString)
SetBody sets the value of Body.
func (*PushNotification) SetDeviceId ¶
func (s *PushNotification) SetDeviceId(val string)
SetDeviceId sets the value of DeviceId.
func (*PushNotification) SetNotificationType ¶
func (s *PushNotification) SetNotificationType(val string)
SetNotificationType sets the value of NotificationType.
func (*PushNotification) SetTitle ¶
func (s *PushNotification) SetTitle(val string)
SetTitle sets the value of Title.
func (*PushNotification) UnmarshalJSON ¶
func (s *PushNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*PushNotification) Validate ¶
func (s *PushNotification) Validate() error
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationGroup ¶ added in v1.17.0
OperationGroup returns the x-ogen-operation-group value.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SMSNotification ¶
type SMSNotification struct {
NotificationType string `json:"notificationType"`
PhoneNumber string `json:"phoneNumber"`
Message string `json:"message"`
}
Ref: #/components/schemas/SMSNotification
func (*SMSNotification) Decode ¶
func (s *SMSNotification) Decode(d *jx.Decoder) error
Decode decodes SMSNotification from json.
func (*SMSNotification) Encode ¶
func (s *SMSNotification) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*SMSNotification) GetMessage ¶
func (s *SMSNotification) GetMessage() string
GetMessage returns the value of Message.
func (*SMSNotification) GetNotificationType ¶
func (s *SMSNotification) GetNotificationType() string
GetNotificationType returns the value of NotificationType.
func (*SMSNotification) GetPhoneNumber ¶
func (s *SMSNotification) GetPhoneNumber() string
GetPhoneNumber returns the value of PhoneNumber.
func (*SMSNotification) MarshalJSON ¶
func (s *SMSNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*SMSNotification) SetMessage ¶
func (s *SMSNotification) SetMessage(val string)
SetMessage sets the value of Message.
func (*SMSNotification) SetNotificationType ¶
func (s *SMSNotification) SetNotificationType(val string)
SetNotificationType sets the value of NotificationType.
func (*SMSNotification) SetPhoneNumber ¶
func (s *SMSNotification) SetPhoneNumber(val string)
SetPhoneNumber sets the value of PhoneNumber.
func (*SMSNotification) UnmarshalJSON ¶
func (s *SMSNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*SMSNotification) Validate ¶
func (s *SMSNotification) Validate() error
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, 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) CreatePet ¶
CreatePet implements createPet operation.
Create a pet.
POST /pets
func (UnimplementedHandler) ListNotifications ¶
func (UnimplementedHandler) ListNotifications(ctx context.Context) (r []Notification, _ error)
ListNotifications implements listNotifications operation.
List notifications.
GET /notifications
func (UnimplementedHandler) ListPets ¶
func (UnimplementedHandler) ListPets(ctx context.Context) (r []Pet, _ error)
ListPets implements listPets operation.
List pets.
GET /pets
func (UnimplementedHandler) ListVehicles ¶
func (UnimplementedHandler) ListVehicles(ctx context.Context) (r []Vehicle, _ error)
ListVehicles implements listVehicles operation.
List vehicles.
GET /vehicles
type Vehicle ¶
type Vehicle struct {
Type VehicleType // switch on this field
Car Car
Motorcycle Motorcycle
}
Ref: #/components/schemas/Vehicle Vehicle represents sum type.
func NewMotorcycleVehicle ¶
func NewMotorcycleVehicle(v Motorcycle) Vehicle
NewMotorcycleVehicle returns new Vehicle from Motorcycle.
func (Vehicle) GetMotorcycle ¶
func (s Vehicle) GetMotorcycle() (v Motorcycle, ok bool)
GetMotorcycle returns Motorcycle and true boolean if Vehicle is Motorcycle.
func (Vehicle) IsMotorcycle ¶
IsMotorcycle reports whether Vehicle is Motorcycle.
func (Vehicle) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Vehicle) SetMotorcycle ¶
func (s *Vehicle) SetMotorcycle(v Motorcycle)
SetMotorcycle sets Vehicle to Motorcycle.
func (*Vehicle) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type VehicleType ¶
type VehicleType string
VehicleType is oneOf type of Vehicle.
const ( CarVehicle VehicleType = "Car" MotorcycleVehicle VehicleType = "Motorcycle" )
Possible values for VehicleType.
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_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_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go