Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- Constants
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- type ClientOption
- type DatasourceAvailability
- type DatasourceAvailabilityItem
- func (s *DatasourceAvailabilityItem) Decode(d *jx.Decoder) error
- func (s *DatasourceAvailabilityItem) Encode(e *jx.Encoder)
- func (s *DatasourceAvailabilityItem) GetDate() OptString
- func (s *DatasourceAvailabilityItem) GetStopAndSearch() []string
- func (s *DatasourceAvailabilityItem) MarshalJSON() ([]byte, error)
- func (s *DatasourceAvailabilityItem) SetDate(val OptString)
- func (s *DatasourceAvailabilityItem) SetStopAndSearch(val []string)
- func (s *DatasourceAvailabilityItem) UnmarshalJSON(data []byte) error
- func (s *DatasourceAvailabilityItem) Validate() error
- type ErrorHandler
- type GetPoliceForceNotFound
- type GetPoliceForceParams
- type GetPoliceForceRes
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type OptNilPoliceForceEngagementMethodsItemArray
- func (o *OptNilPoliceForceEngagementMethodsItemArray) Decode(d *jx.Decoder) error
- func (o OptNilPoliceForceEngagementMethodsItemArray) Encode(e *jx.Encoder)
- func (o OptNilPoliceForceEngagementMethodsItemArray) Get() (v []PoliceForceEngagementMethodsItem, ok bool)
- func (o OptNilPoliceForceEngagementMethodsItemArray) IsNull() bool
- func (o OptNilPoliceForceEngagementMethodsItemArray) IsSet() bool
- func (s OptNilPoliceForceEngagementMethodsItemArray) MarshalJSON() ([]byte, error)
- func (o OptNilPoliceForceEngagementMethodsItemArray) Or(d []PoliceForceEngagementMethodsItem) []PoliceForceEngagementMethodsItem
- func (o *OptNilPoliceForceEngagementMethodsItemArray) Reset()
- func (o *OptNilPoliceForceEngagementMethodsItemArray) SetTo(v []PoliceForceEngagementMethodsItem)
- func (o *OptNilPoliceForceEngagementMethodsItemArray) SetToNull()
- func (s *OptNilPoliceForceEngagementMethodsItemArray) UnmarshalJSON(data []byte) error
- type OptNilString
- func (o *OptNilString) Decode(d *jx.Decoder) error
- func (o OptNilString) Encode(e *jx.Encoder)
- func (o OptNilString) Get() (v string, ok bool)
- func (o OptNilString) IsNull() bool
- func (o OptNilString) IsSet() bool
- func (s OptNilString) MarshalJSON() ([]byte, error)
- func (o OptNilString) Or(d string) string
- func (o *OptNilString) Reset()
- func (o *OptNilString) SetTo(v string)
- func (o *OptNilString) SetToNull()
- func (s *OptNilString) UnmarshalJSON(data []byte) error
- type OptNilURI
- func (o *OptNilURI) Decode(d *jx.Decoder) error
- func (o OptNilURI) Encode(e *jx.Encoder)
- func (o OptNilURI) Get() (v url.URL, ok bool)
- func (o OptNilURI) IsNull() bool
- func (o OptNilURI) IsSet() bool
- func (s OptNilURI) MarshalJSON() ([]byte, error)
- func (o OptNilURI) Or(d url.URL) url.URL
- func (o *OptNilURI) Reset()
- func (o *OptNilURI) SetTo(v url.URL)
- func (o *OptNilURI) SetToNull()
- func (s *OptNilURI) UnmarshalJSON(data []byte) error
- type OptPoliceForceId
- func (o *OptPoliceForceId) Decode(d *jx.Decoder) error
- func (o OptPoliceForceId) Encode(e *jx.Encoder)
- func (o OptPoliceForceId) Get() (v PoliceForceId, ok bool)
- func (o OptPoliceForceId) IsSet() bool
- func (s OptPoliceForceId) MarshalJSON() ([]byte, error)
- func (o OptPoliceForceId) Or(d PoliceForceId) PoliceForceId
- func (o *OptPoliceForceId) Reset()
- func (o *OptPoliceForceId) SetTo(v PoliceForceId)
- func (s *OptPoliceForceId) UnmarshalJSON(data []byte) error
- type OptPoliceForceName
- func (o *OptPoliceForceName) Decode(d *jx.Decoder) error
- func (o OptPoliceForceName) Encode(e *jx.Encoder)
- func (o OptPoliceForceName) Get() (v PoliceForceName, ok bool)
- func (o OptPoliceForceName) IsSet() bool
- func (s OptPoliceForceName) MarshalJSON() ([]byte, error)
- func (o OptPoliceForceName) Or(d PoliceForceName) PoliceForceName
- func (o *OptPoliceForceName) Reset()
- func (o *OptPoliceForceName) SetTo(v PoliceForceName)
- func (s *OptPoliceForceName) 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 PoliceForce
- func (s *PoliceForce) Decode(d *jx.Decoder) error
- func (s *PoliceForce) Encode(e *jx.Encoder)
- func (s *PoliceForce) GetDescription() OptNilString
- func (s *PoliceForce) GetEngagementMethods() OptNilPoliceForceEngagementMethodsItemArray
- func (s *PoliceForce) GetID() OptPoliceForceId
- func (s *PoliceForce) GetName() OptPoliceForceName
- func (s *PoliceForce) GetTelephone() OptNilString
- func (s *PoliceForce) GetURL() OptNilURI
- func (s *PoliceForce) MarshalJSON() ([]byte, error)
- func (s *PoliceForce) SetDescription(val OptNilString)
- func (s *PoliceForce) SetEngagementMethods(val OptNilPoliceForceEngagementMethodsItemArray)
- func (s *PoliceForce) SetID(val OptPoliceForceId)
- func (s *PoliceForce) SetName(val OptPoliceForceName)
- func (s *PoliceForce) SetTelephone(val OptNilString)
- func (s *PoliceForce) SetURL(val OptNilURI)
- func (s *PoliceForce) UnmarshalJSON(data []byte) error
- func (s *PoliceForce) Validate() error
- type PoliceForceEngagementMethodsItem
- func (s *PoliceForceEngagementMethodsItem) Decode(d *jx.Decoder) error
- func (s *PoliceForceEngagementMethodsItem) Encode(e *jx.Encoder)
- func (s *PoliceForceEngagementMethodsItem) GetDescription() OptNilString
- func (s *PoliceForceEngagementMethodsItem) GetTitle() OptString
- func (s *PoliceForceEngagementMethodsItem) GetURL() OptNilString
- func (s *PoliceForceEngagementMethodsItem) MarshalJSON() ([]byte, error)
- func (s *PoliceForceEngagementMethodsItem) SetDescription(val OptNilString)
- func (s *PoliceForceEngagementMethodsItem) SetTitle(val OptString)
- func (s *PoliceForceEngagementMethodsItem) SetURL(val OptNilString)
- func (s *PoliceForceEngagementMethodsItem) UnmarshalJSON(data []byte) error
- type PoliceForceId
- type PoliceForceName
- type PoliceForces
- type PoliceForcesItem
- func (s *PoliceForcesItem) Decode(d *jx.Decoder) error
- func (s *PoliceForcesItem) Encode(e *jx.Encoder)
- func (s *PoliceForcesItem) GetID() OptPoliceForceId
- func (s *PoliceForcesItem) GetName() OptPoliceForceName
- func (s *PoliceForcesItem) MarshalJSON() ([]byte, error)
- func (s *PoliceForcesItem) SetID(val OptPoliceForceId)
- func (s *PoliceForcesItem) SetName(val OptPoliceForceName)
- func (s *PoliceForcesItem) UnmarshalJSON(data []byte) error
- type Route
- 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) GetDatasetAvailability(ctx context.Context) (r DatasourceAvailability, _ error)
- func (UnimplementedHandler) GetPoliceForce(ctx context.Context, params GetPoliceForceParams) (r GetPoliceForceRes, _ error)
- func (UnimplementedHandler) ListPoliceForces(ctx context.Context) (r PoliceForces, _ error)
Constants ¶
const (
ServerURL = "https://data.police.uk/api"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) GetDatasetAvailability ¶
func (c *Client) GetDatasetAvailability(ctx context.Context) (DatasourceAvailability, error)
GetDatasetAvailability invokes getDatasetAvailability operation.
Get a list of available datasets by date and police force.
GET /crimes-street-dates
func (*Client) GetPoliceForce ¶
func (c *Client) GetPoliceForce(ctx context.Context, params GetPoliceForceParams) (GetPoliceForceRes, error)
GetPoliceForce invokes getPoliceForce operation.
Get detailed information about a specific police force.
GET /forces/{forceId}
func (*Client) ListPoliceForces ¶
func (c *Client) ListPoliceForces(ctx context.Context) (PoliceForces, error)
ListPoliceForces invokes listPoliceForces operation.
List all of the police forces available within the data.police.uk dataset.
GET /forces
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 DatasourceAvailability ¶
type DatasourceAvailability []DatasourceAvailabilityItem
func (*DatasourceAvailability) Decode ¶
func (s *DatasourceAvailability) Decode(d *jx.Decoder) error
Decode decodes DatasourceAvailability from json.
func (DatasourceAvailability) Encode ¶
func (s DatasourceAvailability) Encode(e *jx.Encoder)
Encode encodes DatasourceAvailability as json.
func (DatasourceAvailability) MarshalJSON ¶
func (s DatasourceAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*DatasourceAvailability) UnmarshalJSON ¶
func (s *DatasourceAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (DatasourceAvailability) Validate ¶
func (s DatasourceAvailability) Validate() error
type DatasourceAvailabilityItem ¶
type DatasourceAvailabilityItem struct { // ISO-8601 formatted year and date. Date OptString `json:"date"` // List of police forces providing stop and search information for the given month and year. StopAndSearch []string `json:"stop-and-search"` }
func (*DatasourceAvailabilityItem) Decode ¶
func (s *DatasourceAvailabilityItem) Decode(d *jx.Decoder) error
Decode decodes DatasourceAvailabilityItem from json.
func (*DatasourceAvailabilityItem) Encode ¶
func (s *DatasourceAvailabilityItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*DatasourceAvailabilityItem) GetDate ¶
func (s *DatasourceAvailabilityItem) GetDate() OptString
GetDate returns the value of Date.
func (*DatasourceAvailabilityItem) GetStopAndSearch ¶
func (s *DatasourceAvailabilityItem) GetStopAndSearch() []string
GetStopAndSearch returns the value of StopAndSearch.
func (*DatasourceAvailabilityItem) MarshalJSON ¶
func (s *DatasourceAvailabilityItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*DatasourceAvailabilityItem) SetDate ¶
func (s *DatasourceAvailabilityItem) SetDate(val OptString)
SetDate sets the value of Date.
func (*DatasourceAvailabilityItem) SetStopAndSearch ¶
func (s *DatasourceAvailabilityItem) SetStopAndSearch(val []string)
SetStopAndSearch sets the value of StopAndSearch.
func (*DatasourceAvailabilityItem) UnmarshalJSON ¶
func (s *DatasourceAvailabilityItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*DatasourceAvailabilityItem) Validate ¶
func (s *DatasourceAvailabilityItem) Validate() error
type GetPoliceForceNotFound ¶
type GetPoliceForceNotFound struct{}
GetPoliceForceNotFound is response for GetPoliceForce operation.
type GetPoliceForceParams ¶
type GetPoliceForceParams struct { // ID of the police force to fetch information about. ForceId PoliceForceId }
GetPoliceForceParams is parameters of getPoliceForce operation.
type GetPoliceForceRes ¶
type GetPoliceForceRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface { // GetDatasetAvailability implements getDatasetAvailability operation. // // Get a list of available datasets by date and police force. // // GET /crimes-street-dates GetDatasetAvailability(ctx context.Context) (DatasourceAvailability, error) // GetPoliceForce implements getPoliceForce operation. // // Get detailed information about a specific police force. // // GET /forces/{forceId} GetPoliceForce(ctx context.Context, params GetPoliceForceParams) (GetPoliceForceRes, error) // ListPoliceForces implements listPoliceForces operation. // // List all of the police forces available within the data.police.uk dataset. // // GET /forces ListPoliceForces(ctx context.Context) (PoliceForces, error) }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // GetDatasetAvailability invokes getDatasetAvailability operation. // // Get a list of available datasets by date and police force. // // GET /crimes-street-dates GetDatasetAvailability(ctx context.Context) (DatasourceAvailability, error) // GetPoliceForce invokes getPoliceForce operation. // // Get detailed information about a specific police force. // // GET /forces/{forceId} GetPoliceForce(ctx context.Context, params GetPoliceForceParams) (GetPoliceForceRes, error) // ListPoliceForces invokes listPoliceForces operation. // // List all of the police forces available within the data.police.uk dataset. // // GET /forces ListPoliceForces(ctx context.Context) (PoliceForces, 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 OptNilPoliceForceEngagementMethodsItemArray ¶
type OptNilPoliceForceEngagementMethodsItemArray struct { Value []PoliceForceEngagementMethodsItem Set bool Null bool }
OptNilPoliceForceEngagementMethodsItemArray is optional nullable []PoliceForceEngagementMethodsItem.
func NewOptNilPoliceForceEngagementMethodsItemArray ¶
func NewOptNilPoliceForceEngagementMethodsItemArray(v []PoliceForceEngagementMethodsItem) OptNilPoliceForceEngagementMethodsItemArray
NewOptNilPoliceForceEngagementMethodsItemArray returns new OptNilPoliceForceEngagementMethodsItemArray with value set to v.
func (*OptNilPoliceForceEngagementMethodsItemArray) Decode ¶
func (o *OptNilPoliceForceEngagementMethodsItemArray) Decode(d *jx.Decoder) error
Decode decodes []PoliceForceEngagementMethodsItem from json.
func (OptNilPoliceForceEngagementMethodsItemArray) Encode ¶
func (o OptNilPoliceForceEngagementMethodsItemArray) Encode(e *jx.Encoder)
Encode encodes []PoliceForceEngagementMethodsItem as json.
func (OptNilPoliceForceEngagementMethodsItemArray) Get ¶
func (o OptNilPoliceForceEngagementMethodsItemArray) Get() (v []PoliceForceEngagementMethodsItem, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptNilPoliceForceEngagementMethodsItemArray) IsNull ¶
func (o OptNilPoliceForceEngagementMethodsItemArray) IsNull() bool
IsSet returns true if value is Null.
func (OptNilPoliceForceEngagementMethodsItemArray) IsSet ¶
func (o OptNilPoliceForceEngagementMethodsItemArray) IsSet() bool
IsSet returns true if OptNilPoliceForceEngagementMethodsItemArray was set.
func (OptNilPoliceForceEngagementMethodsItemArray) MarshalJSON ¶
func (s OptNilPoliceForceEngagementMethodsItemArray) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptNilPoliceForceEngagementMethodsItemArray) Or ¶
func (o OptNilPoliceForceEngagementMethodsItemArray) Or(d []PoliceForceEngagementMethodsItem) []PoliceForceEngagementMethodsItem
Or returns value if set, or given parameter if does not.
func (*OptNilPoliceForceEngagementMethodsItemArray) Reset ¶
func (o *OptNilPoliceForceEngagementMethodsItemArray) Reset()
Reset unsets value.
func (*OptNilPoliceForceEngagementMethodsItemArray) SetTo ¶
func (o *OptNilPoliceForceEngagementMethodsItemArray) SetTo(v []PoliceForceEngagementMethodsItem)
SetTo sets value to v.
func (*OptNilPoliceForceEngagementMethodsItemArray) SetToNull ¶
func (o *OptNilPoliceForceEngagementMethodsItemArray) SetToNull()
SetNull sets value to null.
func (*OptNilPoliceForceEngagementMethodsItemArray) UnmarshalJSON ¶
func (s *OptNilPoliceForceEngagementMethodsItemArray) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptNilString ¶
OptNilString is optional nullable string.
func NewOptNilString ¶
func NewOptNilString(v string) OptNilString
NewOptNilString returns new OptNilString with value set to v.
func (*OptNilString) Decode ¶
func (o *OptNilString) Decode(d *jx.Decoder) error
Decode decodes string from json.
func (OptNilString) Encode ¶
func (o OptNilString) Encode(e *jx.Encoder)
Encode encodes string as json.
func (OptNilString) Get ¶
func (o OptNilString) Get() (v string, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptNilString) IsNull ¶
func (o OptNilString) IsNull() bool
IsSet returns true if value is Null.
func (OptNilString) IsSet ¶
func (o OptNilString) IsSet() bool
IsSet returns true if OptNilString was set.
func (OptNilString) MarshalJSON ¶
func (s OptNilString) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptNilString) Or ¶
func (o OptNilString) Or(d string) string
Or returns value if set, or given parameter if does not.
func (*OptNilString) UnmarshalJSON ¶
func (s *OptNilString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptNilURI ¶
OptNilURI is optional nullable url.URL.
func NewOptNilURI ¶
NewOptNilURI returns new OptNilURI with value set to v.
func (OptNilURI) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptNilURI) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptPoliceForceId ¶
type OptPoliceForceId struct { Value PoliceForceId Set bool }
OptPoliceForceId is optional PoliceForceId.
func NewOptPoliceForceId ¶
func NewOptPoliceForceId(v PoliceForceId) OptPoliceForceId
NewOptPoliceForceId returns new OptPoliceForceId with value set to v.
func (*OptPoliceForceId) Decode ¶
func (o *OptPoliceForceId) Decode(d *jx.Decoder) error
Decode decodes PoliceForceId from json.
func (OptPoliceForceId) Encode ¶
func (o OptPoliceForceId) Encode(e *jx.Encoder)
Encode encodes PoliceForceId as json.
func (OptPoliceForceId) Get ¶
func (o OptPoliceForceId) Get() (v PoliceForceId, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptPoliceForceId) IsSet ¶
func (o OptPoliceForceId) IsSet() bool
IsSet returns true if OptPoliceForceId was set.
func (OptPoliceForceId) MarshalJSON ¶
func (s OptPoliceForceId) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptPoliceForceId) Or ¶
func (o OptPoliceForceId) Or(d PoliceForceId) PoliceForceId
Or returns value if set, or given parameter if does not.
func (*OptPoliceForceId) SetTo ¶
func (o *OptPoliceForceId) SetTo(v PoliceForceId)
SetTo sets value to v.
func (*OptPoliceForceId) UnmarshalJSON ¶
func (s *OptPoliceForceId) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptPoliceForceName ¶
type OptPoliceForceName struct { Value PoliceForceName Set bool }
OptPoliceForceName is optional PoliceForceName.
func NewOptPoliceForceName ¶
func NewOptPoliceForceName(v PoliceForceName) OptPoliceForceName
NewOptPoliceForceName returns new OptPoliceForceName with value set to v.
func (*OptPoliceForceName) Decode ¶
func (o *OptPoliceForceName) Decode(d *jx.Decoder) error
Decode decodes PoliceForceName from json.
func (OptPoliceForceName) Encode ¶
func (o OptPoliceForceName) Encode(e *jx.Encoder)
Encode encodes PoliceForceName as json.
func (OptPoliceForceName) Get ¶
func (o OptPoliceForceName) Get() (v PoliceForceName, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptPoliceForceName) IsSet ¶
func (o OptPoliceForceName) IsSet() bool
IsSet returns true if OptPoliceForceName was set.
func (OptPoliceForceName) MarshalJSON ¶
func (s OptPoliceForceName) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptPoliceForceName) Or ¶
func (o OptPoliceForceName) Or(d PoliceForceName) PoliceForceName
Or returns value if set, or given parameter if does not.
func (*OptPoliceForceName) SetTo ¶
func (o *OptPoliceForceName) SetTo(v PoliceForceName)
SetTo sets value to v.
func (*OptPoliceForceName) UnmarshalJSON ¶
func (s *OptPoliceForceName) UnmarshalJSON(data []byte) error
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 PoliceForce ¶
type PoliceForce struct { // Descriptive information about a police force. This can sometimes contain markup. Description OptNilString `json:"description"` // The police force's website URL. URL OptNilURI `json:"url"` // Police force's non-emergency contact telephone number. Telephone OptNilString `json:"telephone"` ID OptPoliceForceId `json:"id"` Name OptPoliceForceName `json:"name"` // List of ways to be informed about the police force. EngagementMethods OptNilPoliceForceEngagementMethodsItemArray `json:"engagement_methods"` }
Ref: #/components/schemas/PoliceForce
func (*PoliceForce) Decode ¶
func (s *PoliceForce) Decode(d *jx.Decoder) error
Decode decodes PoliceForce from json.
func (*PoliceForce) Encode ¶
func (s *PoliceForce) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PoliceForce) GetDescription ¶
func (s *PoliceForce) GetDescription() OptNilString
GetDescription returns the value of Description.
func (*PoliceForce) GetEngagementMethods ¶
func (s *PoliceForce) GetEngagementMethods() OptNilPoliceForceEngagementMethodsItemArray
GetEngagementMethods returns the value of EngagementMethods.
func (*PoliceForce) GetID ¶
func (s *PoliceForce) GetID() OptPoliceForceId
GetID returns the value of ID.
func (*PoliceForce) GetName ¶
func (s *PoliceForce) GetName() OptPoliceForceName
GetName returns the value of Name.
func (*PoliceForce) GetTelephone ¶
func (s *PoliceForce) GetTelephone() OptNilString
GetTelephone returns the value of Telephone.
func (*PoliceForce) GetURL ¶
func (s *PoliceForce) GetURL() OptNilURI
GetURL returns the value of URL.
func (*PoliceForce) MarshalJSON ¶
func (s *PoliceForce) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForce) SetDescription ¶
func (s *PoliceForce) SetDescription(val OptNilString)
SetDescription sets the value of Description.
func (*PoliceForce) SetEngagementMethods ¶
func (s *PoliceForce) SetEngagementMethods(val OptNilPoliceForceEngagementMethodsItemArray)
SetEngagementMethods sets the value of EngagementMethods.
func (*PoliceForce) SetID ¶
func (s *PoliceForce) SetID(val OptPoliceForceId)
SetID sets the value of ID.
func (*PoliceForce) SetName ¶
func (s *PoliceForce) SetName(val OptPoliceForceName)
SetName sets the value of Name.
func (*PoliceForce) SetTelephone ¶
func (s *PoliceForce) SetTelephone(val OptNilString)
SetTelephone sets the value of Telephone.
func (*PoliceForce) SetURL ¶
func (s *PoliceForce) SetURL(val OptNilURI)
SetURL sets the value of URL.
func (*PoliceForce) UnmarshalJSON ¶
func (s *PoliceForce) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*PoliceForce) Validate ¶
func (s *PoliceForce) Validate() error
type PoliceForceEngagementMethodsItem ¶
type PoliceForceEngagementMethodsItem struct { // URL of the engagement method. URL OptNilString `json:"url"` // Descriptive information about the police force's engagement method. Description OptNilString `json:"description"` // Title of the engagement method. Title OptString `json:"title"` }
func (*PoliceForceEngagementMethodsItem) Decode ¶
func (s *PoliceForceEngagementMethodsItem) Decode(d *jx.Decoder) error
Decode decodes PoliceForceEngagementMethodsItem from json.
func (*PoliceForceEngagementMethodsItem) Encode ¶
func (s *PoliceForceEngagementMethodsItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PoliceForceEngagementMethodsItem) GetDescription ¶
func (s *PoliceForceEngagementMethodsItem) GetDescription() OptNilString
GetDescription returns the value of Description.
func (*PoliceForceEngagementMethodsItem) GetTitle ¶
func (s *PoliceForceEngagementMethodsItem) GetTitle() OptString
GetTitle returns the value of Title.
func (*PoliceForceEngagementMethodsItem) GetURL ¶
func (s *PoliceForceEngagementMethodsItem) GetURL() OptNilString
GetURL returns the value of URL.
func (*PoliceForceEngagementMethodsItem) MarshalJSON ¶
func (s *PoliceForceEngagementMethodsItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForceEngagementMethodsItem) SetDescription ¶
func (s *PoliceForceEngagementMethodsItem) SetDescription(val OptNilString)
SetDescription sets the value of Description.
func (*PoliceForceEngagementMethodsItem) SetTitle ¶
func (s *PoliceForceEngagementMethodsItem) SetTitle(val OptString)
SetTitle sets the value of Title.
func (*PoliceForceEngagementMethodsItem) SetURL ¶
func (s *PoliceForceEngagementMethodsItem) SetURL(val OptNilString)
SetURL sets the value of URL.
func (*PoliceForceEngagementMethodsItem) UnmarshalJSON ¶
func (s *PoliceForceEngagementMethodsItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PoliceForceId ¶
type PoliceForceId string
func (*PoliceForceId) Decode ¶
func (s *PoliceForceId) Decode(d *jx.Decoder) error
Decode decodes PoliceForceId from json.
func (PoliceForceId) Encode ¶
func (s PoliceForceId) Encode(e *jx.Encoder)
Encode encodes PoliceForceId as json.
func (PoliceForceId) MarshalJSON ¶
func (s PoliceForceId) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForceId) UnmarshalJSON ¶
func (s *PoliceForceId) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PoliceForceName ¶
type PoliceForceName string
func (*PoliceForceName) Decode ¶
func (s *PoliceForceName) Decode(d *jx.Decoder) error
Decode decodes PoliceForceName from json.
func (PoliceForceName) Encode ¶
func (s PoliceForceName) Encode(e *jx.Encoder)
Encode encodes PoliceForceName as json.
func (PoliceForceName) MarshalJSON ¶
func (s PoliceForceName) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForceName) UnmarshalJSON ¶
func (s *PoliceForceName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PoliceForces ¶
type PoliceForces []PoliceForcesItem
func (*PoliceForces) Decode ¶
func (s *PoliceForces) Decode(d *jx.Decoder) error
Decode decodes PoliceForces from json.
func (PoliceForces) Encode ¶
func (s PoliceForces) Encode(e *jx.Encoder)
Encode encodes PoliceForces as json.
func (PoliceForces) MarshalJSON ¶
func (s PoliceForces) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForces) UnmarshalJSON ¶
func (s *PoliceForces) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (PoliceForces) Validate ¶
func (s PoliceForces) Validate() error
type PoliceForcesItem ¶
type PoliceForcesItem struct { ID OptPoliceForceId `json:"id"` Name OptPoliceForceName `json:"name"` }
func (*PoliceForcesItem) Decode ¶
func (s *PoliceForcesItem) Decode(d *jx.Decoder) error
Decode decodes PoliceForcesItem from json.
func (*PoliceForcesItem) Encode ¶
func (s *PoliceForcesItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PoliceForcesItem) GetID ¶
func (s *PoliceForcesItem) GetID() OptPoliceForceId
GetID returns the value of ID.
func (*PoliceForcesItem) GetName ¶
func (s *PoliceForcesItem) GetName() OptPoliceForceName
GetName returns the value of Name.
func (*PoliceForcesItem) MarshalJSON ¶
func (s *PoliceForcesItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PoliceForcesItem) SetID ¶
func (s *PoliceForcesItem) SetID(val OptPoliceForceId)
SetID sets the value of ID.
func (*PoliceForcesItem) SetName ¶
func (s *PoliceForcesItem) SetName(val OptPoliceForceName)
SetName sets the value of Name.
func (*PoliceForcesItem) UnmarshalJSON ¶
func (s *PoliceForcesItem) UnmarshalJSON(data []byte) error
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 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) GetDatasetAvailability ¶
func (UnimplementedHandler) GetDatasetAvailability(ctx context.Context) (r DatasourceAvailability, _ error)
GetDatasetAvailability implements getDatasetAvailability operation.
Get a list of available datasets by date and police force.
GET /crimes-street-dates
func (UnimplementedHandler) GetPoliceForce ¶
func (UnimplementedHandler) GetPoliceForce(ctx context.Context, params GetPoliceForceParams) (r GetPoliceForceRes, _ error)
GetPoliceForce implements getPoliceForce operation.
Get detailed information about a specific police force.
GET /forces/{forceId}
func (UnimplementedHandler) ListPoliceForces ¶
func (UnimplementedHandler) ListPoliceForces(ctx context.Context) (r PoliceForces, _ error)
ListPoliceForces implements listPoliceForces operation.
List all of the police forces available within the data.police.uk dataset.
GET /forces
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_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go
- package.go