api

package
v0.0.0-...-2e755d1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

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

WithServerURL sets context key to override server URL.

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

func (c *Client) CreateTemplate(ctx context.Context, request *Template) (*Template, error)

CreateTemplate invokes createTemplate operation.

POST /templates

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context) ([]Template, error)

ListTemplates invokes listTemplates operation.

GET /templates

type ClientOption

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

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Folder

type Folder struct {
	Name string `json:"name"`
}

Ref: #/components/schemas/Folder

func (*Folder) Decode

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

Decode decodes Folder from json.

func (*Folder) Encode

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

Encode implements json.Marshaler.

func (*Folder) GetName

func (s *Folder) GetName() string

GetName returns the value of Name.

func (*Folder) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Folder) SetFake

func (s *Folder) SetFake()

SetFake set fake values.

func (*Folder) SetName

func (s *Folder) SetName(val string)

SetName sets the value of Name.

func (*Folder) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// CreateTemplate implements createTemplate operation.
	//
	// POST /templates
	CreateTemplate(ctx context.Context, req *Template) (*Template, error)
	// ListTemplates implements listTemplates operation.
	//
	// GET /templates
	ListTemplates(ctx context.Context) ([]Template, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// CreateTemplate invokes createTemplate operation.
	//
	// POST /templates
	CreateTemplate(ctx context.Context, request *Template) (*Template, error)
	// ListTemplates invokes listTemplates operation.
	//
	// GET /templates
	ListTemplates(ctx context.Context) ([]Template, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

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

func LabelerFromContext

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

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

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

func (*Labeler) Add

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

Add attributes to the Labeler.

func (*Labeler) AttributeSet

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

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

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type NilString

type NilString struct {
	Value string
	Null  bool
}

NilString is nullable string.

func NewNilString

func NewNilString(v string) NilString

NewNilString returns new NilString with value set to v.

func (*NilString) Decode

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

Decode decodes string from json.

func (NilString) Encode

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

Encode encodes string as json.

func (NilString) Get

func (o NilString) Get() (v string, ok bool)

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

func (NilString) IsNull

func (o NilString) IsNull() bool

IsNull returns true if value is Null.

func (NilString) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (NilString) Or

func (o NilString) Or(d string) string

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

func (*NilString) SetFake

func (s *NilString) SetFake()

SetFake set fake values.

func (*NilString) SetTo

func (o *NilString) SetTo(v string)

SetTo sets value to v.

func (*NilString) SetToNull

func (o *NilString) SetToNull()

SetToNull sets value to null.

func (*NilString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	CreateTemplateOperation OperationName = "CreateTemplate"
	ListTemplatesOperation  OperationName = "ListTemplates"
)

type OptNilDateTime

type OptNilDateTime struct {
	Value time.Time
	Set   bool
	Null  bool
}

OptNilDateTime is optional nullable time.Time.

func NewOptNilDateTime

func NewOptNilDateTime(v time.Time) OptNilDateTime

NewOptNilDateTime returns new OptNilDateTime with value set to v.

func (*OptNilDateTime) Decode

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

Decode decodes time.Time from json.

func (OptNilDateTime) Encode

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

Encode encodes time.Time as json.

func (OptNilDateTime) Get

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

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

func (OptNilDateTime) IsEmpty

func (o OptNilDateTime) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilDateTime) IsNull

func (o OptNilDateTime) IsNull() bool

IsNull returns true if value is Null.

func (OptNilDateTime) IsSet

func (o OptNilDateTime) IsSet() bool

IsSet returns true if OptNilDateTime was set.

func (OptNilDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilDateTime) Or

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

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

func (*OptNilDateTime) Reset

func (o *OptNilDateTime) Reset()

Reset unsets value.

func (*OptNilDateTime) SetFake

func (s *OptNilDateTime) SetFake()

SetFake set fake values.

func (*OptNilDateTime) SetTo

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

SetTo sets value to v.

func (*OptNilDateTime) SetToNull

func (o *OptNilDateTime) SetToNull()

SetToNull sets value to null.

func (*OptNilDateTime) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilFolder

type OptNilFolder struct {
	Value Folder
	Set   bool
	Null  bool
}

OptNilFolder is optional nullable Folder.

func NewOptNilFolder

func NewOptNilFolder(v Folder) OptNilFolder

NewOptNilFolder returns new OptNilFolder with value set to v.

func (*OptNilFolder) Decode

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

Decode decodes Folder from json.

func (OptNilFolder) Encode

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

Encode encodes Folder as json.

func (OptNilFolder) Get

func (o OptNilFolder) Get() (v Folder, ok bool)

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

func (OptNilFolder) IsEmpty

func (o OptNilFolder) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilFolder) IsNull

func (o OptNilFolder) IsNull() bool

IsNull returns true if value is Null.

func (OptNilFolder) IsSet

func (o OptNilFolder) IsSet() bool

IsSet returns true if OptNilFolder was set.

func (OptNilFolder) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilFolder) Or

func (o OptNilFolder) Or(d Folder) Folder

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

func (*OptNilFolder) Reset

func (o *OptNilFolder) Reset()

Reset unsets value.

func (*OptNilFolder) SetFake

func (s *OptNilFolder) SetFake()

SetFake set fake values.

func (*OptNilFolder) SetTo

func (o *OptNilFolder) SetTo(v Folder)

SetTo sets value to v.

func (*OptNilFolder) SetToNull

func (o *OptNilFolder) SetToNull()

SetToNull sets value to null.

func (*OptNilFolder) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilInt

type OptNilInt struct {
	Value int
	Set   bool
	Null  bool
}

OptNilInt is optional nullable int.

func NewOptNilInt

func NewOptNilInt(v int) OptNilInt

NewOptNilInt returns new OptNilInt with value set to v.

func (*OptNilInt) Decode

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

Decode decodes int from json.

func (OptNilInt) Encode

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

Encode encodes int as json.

func (OptNilInt) Get

func (o OptNilInt) Get() (v int, ok bool)

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

func (OptNilInt) IsEmpty

func (o OptNilInt) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilInt) IsNull

func (o OptNilInt) IsNull() bool

IsNull returns true if value is Null.

func (OptNilInt) IsSet

func (o OptNilInt) IsSet() bool

IsSet returns true if OptNilInt was set.

func (OptNilInt) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilInt) Or

func (o OptNilInt) Or(d int) int

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

func (*OptNilInt) Reset

func (o *OptNilInt) Reset()

Reset unsets value.

func (*OptNilInt) SetFake

func (s *OptNilInt) SetFake()

SetFake set fake values.

func (*OptNilInt) SetTo

func (o *OptNilInt) SetTo(v int)

SetTo sets value to v.

func (*OptNilInt) SetToNull

func (o *OptNilInt) SetToNull()

SetToNull sets value to null.

func (*OptNilInt) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilNilStringArray

type OptNilNilStringArray struct {
	Value []NilString
	Set   bool
	Null  bool
}

OptNilNilStringArray is optional nullable []NilString.

func NewOptNilNilStringArray

func NewOptNilNilStringArray(v []NilString) OptNilNilStringArray

NewOptNilNilStringArray returns new OptNilNilStringArray with value set to v.

func (*OptNilNilStringArray) Decode

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

Decode decodes []NilString from json.

func (OptNilNilStringArray) Encode

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

Encode encodes []NilString as json.

func (OptNilNilStringArray) Get

func (o OptNilNilStringArray) Get() (v []NilString, ok bool)

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

func (OptNilNilStringArray) IsEmpty

func (o OptNilNilStringArray) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilNilStringArray) IsNull

func (o OptNilNilStringArray) IsNull() bool

IsNull returns true if value is Null.

func (OptNilNilStringArray) IsSet

func (o OptNilNilStringArray) IsSet() bool

IsSet returns true if OptNilNilStringArray was set.

func (OptNilNilStringArray) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilNilStringArray) Or

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

func (*OptNilNilStringArray) Reset

func (o *OptNilNilStringArray) Reset()

Reset unsets value.

func (*OptNilNilStringArray) SetFake

func (s *OptNilNilStringArray) SetFake()

SetFake set fake values.

func (*OptNilNilStringArray) SetTo

func (o *OptNilNilStringArray) SetTo(v []NilString)

SetTo sets value to v.

func (*OptNilNilStringArray) SetToNull

func (o *OptNilNilStringArray) SetToNull()

SetToNull sets value to null.

func (*OptNilNilStringArray) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilString

type OptNilString struct {
	Value string
	Set   bool
	Null  bool
}

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

func (o OptNilString) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsNull 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) Reset

func (o *OptNilString) Reset()

Reset unsets value.

func (*OptNilString) SetFake

func (s *OptNilString) SetFake()

SetFake set fake values.

func (*OptNilString) SetTo

func (o *OptNilString) SetTo(v string)

SetTo sets value to v.

func (*OptNilString) SetToNull

func (o *OptNilString) SetToNull()

SetToNull sets value to null.

func (*OptNilString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilTemplateStatus

type OptNilTemplateStatus struct {
	Value TemplateStatus
	Set   bool
	Null  bool
}

OptNilTemplateStatus is optional nullable TemplateStatus.

func NewOptNilTemplateStatus

func NewOptNilTemplateStatus(v TemplateStatus) OptNilTemplateStatus

NewOptNilTemplateStatus returns new OptNilTemplateStatus with value set to v.

func (*OptNilTemplateStatus) Decode

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

Decode decodes TemplateStatus from json.

func (OptNilTemplateStatus) Encode

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

Encode encodes TemplateStatus as json.

func (OptNilTemplateStatus) Get

func (o OptNilTemplateStatus) Get() (v TemplateStatus, ok bool)

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

func (OptNilTemplateStatus) IsEmpty

func (o OptNilTemplateStatus) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilTemplateStatus) IsNull

func (o OptNilTemplateStatus) IsNull() bool

IsNull returns true if value is Null.

func (OptNilTemplateStatus) IsSet

func (o OptNilTemplateStatus) IsSet() bool

IsSet returns true if OptNilTemplateStatus was set.

func (OptNilTemplateStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilTemplateStatus) Or

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

func (*OptNilTemplateStatus) Reset

func (o *OptNilTemplateStatus) Reset()

Reset unsets value.

func (*OptNilTemplateStatus) SetFake

func (s *OptNilTemplateStatus) SetFake()

SetFake set fake values.

func (*OptNilTemplateStatus) SetTo

SetTo sets value to v.

func (*OptNilTemplateStatus) SetToNull

func (o *OptNilTemplateStatus) SetToNull()

SetToNull sets value to null.

func (*OptNilTemplateStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

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

Decode decodes string from json.

func (OptString) Encode

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

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

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

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

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

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetFake

func (s *OptString) SetFake()

SetFake set fake values.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

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

WithAttributes specifies default otel attributes.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

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

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

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

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type 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.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

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

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type Template

type Template struct {
	ID         int                  `json:"id"`
	CreatedAt  time.Time            `json:"created_at"`
	ArchivedAt OptNilDateTime       `json:"archived_at"`
	AuthorID   OptNilInt            `json:"author_id"`
	Source     OptNilString         `json:"source"`
	Single     OptString            `json:"single"`
	Status     OptNilTemplateStatus `json:"status"`
	Tags       OptNilNilStringArray `json:"tags"`
	Folder     OptNilFolder         `json:"folder"`
}

Ref: #/components/schemas/Template

func (*Template) Decode

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

Decode decodes Template from json.

func (*Template) Encode

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

Encode implements json.Marshaler.

func (*Template) GetArchivedAt

func (s *Template) GetArchivedAt() OptNilDateTime

GetArchivedAt returns the value of ArchivedAt.

func (*Template) GetAuthorID

func (s *Template) GetAuthorID() OptNilInt

GetAuthorID returns the value of AuthorID.

func (*Template) GetCreatedAt

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

GetCreatedAt returns the value of CreatedAt.

func (*Template) GetFolder

func (s *Template) GetFolder() OptNilFolder

GetFolder returns the value of Folder.

func (*Template) GetID

func (s *Template) GetID() int

GetID returns the value of ID.

func (*Template) GetSingle

func (s *Template) GetSingle() OptString

GetSingle returns the value of Single.

func (*Template) GetSource

func (s *Template) GetSource() OptNilString

GetSource returns the value of Source.

func (*Template) GetStatus

func (s *Template) GetStatus() OptNilTemplateStatus

GetStatus returns the value of Status.

func (*Template) GetTags

func (s *Template) GetTags() OptNilNilStringArray

GetTags returns the value of Tags.

func (*Template) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Template) SetArchivedAt

func (s *Template) SetArchivedAt(val OptNilDateTime)

SetArchivedAt sets the value of ArchivedAt.

func (*Template) SetAuthorID

func (s *Template) SetAuthorID(val OptNilInt)

SetAuthorID sets the value of AuthorID.

func (*Template) SetCreatedAt

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

SetCreatedAt sets the value of CreatedAt.

func (*Template) SetFake

func (s *Template) SetFake()

SetFake set fake values.

func (*Template) SetFolder

func (s *Template) SetFolder(val OptNilFolder)

SetFolder sets the value of Folder.

func (*Template) SetID

func (s *Template) SetID(val int)

SetID sets the value of ID.

func (*Template) SetSingle

func (s *Template) SetSingle(val OptString)

SetSingle sets the value of Single.

func (*Template) SetSource

func (s *Template) SetSource(val OptNilString)

SetSource sets the value of Source.

func (*Template) SetStatus

func (s *Template) SetStatus(val OptNilTemplateStatus)

SetStatus sets the value of Status.

func (*Template) SetTags

func (s *Template) SetTags(val OptNilNilStringArray)

SetTags sets the value of Tags.

func (*Template) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Template) Validate

func (s *Template) Validate() error

type TemplateStatus

type TemplateStatus string
const (
	TemplateStatusDraft     TemplateStatus = "draft"
	TemplateStatusPublished TemplateStatus = "published"
)

func (TemplateStatus) AllValues

func (TemplateStatus) AllValues() []TemplateStatus

AllValues returns all TemplateStatus values.

func (*TemplateStatus) Decode

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

Decode decodes TemplateStatus from json.

func (TemplateStatus) Encode

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

Encode encodes TemplateStatus as json.

func (TemplateStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (TemplateStatus) MarshalText

func (s TemplateStatus) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*TemplateStatus) SetFake

func (s *TemplateStatus) SetFake()

SetFake set fake values.

func (*TemplateStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TemplateStatus) UnmarshalText

func (s *TemplateStatus) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (TemplateStatus) Validate

func (s TemplateStatus) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) CreateTemplate

func (UnimplementedHandler) CreateTemplate(ctx context.Context, req *Template) (r *Template, _ error)

CreateTemplate implements createTemplate operation.

POST /templates

func (UnimplementedHandler) ListTemplates

func (UnimplementedHandler) ListTemplates(ctx context.Context) (r []Template, _ error)

ListTemplates implements listTemplates operation.

GET /templates

Jump to

Keyboard shortcuts

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