store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store tracks component references by writing them into the OpenAPI document's components object.

func New

func New(components *v3.Components) *Store

New creates a Store backed by the given components object.

func (*Store) GetCallback

func (s *Store) GetCallback(name string) (*v3.Callback, bool)

GetCallback returns a stored callback $ref.

func (*Store) GetExample

func (s *Store) GetExample(name string) (*base.Example, bool)

GetExample returns a stored example $ref.

func (*Store) GetHeader

func (s *Store) GetHeader(name string) (*v3.Header, bool)

GetHeader returns a stored header $ref.

func (s *Store) GetLink(name string) (*v3.Link, bool)

GetLink returns a stored link $ref.

func (*Store) GetParameter

func (s *Store) GetParameter(name string) (*v3.Parameter, bool)

GetParameter returns a stored parameter $ref.

func (*Store) GetPathItem

func (s *Store) GetPathItem(name string) (*v3.PathItem, bool)

GetPathItem returns a stored path item $ref.

func (*Store) GetRequestBody

func (s *Store) GetRequestBody(name string) (*v3.RequestBody, bool)

GetRequestBody returns a stored request body $ref.

func (*Store) GetResponse

func (s *Store) GetResponse(name string) (*v3.Response, bool)

GetResponse returns a stored response $ref.

func (*Store) GetSchema

func (s *Store) GetSchema(t reflect.Type) (*base.SchemaProxy, bool)

GetSchema returns a stored schema $ref for t.

func (*Store) GetSecurityScheme

func (s *Store) GetSecurityScheme(name string) (*v3.SecurityScheme, bool)

GetSecurityScheme returns a stored security scheme $ref.

func (*Store) SetCallback

func (s *Store) SetCallback(name string, cb *v3.Callback) *v3.Callback

SetCallback stores a callback in components/callbacks if not already stored, and returns the $ref.

func (*Store) SetExample

func (s *Store) SetExample(name string, e *base.Example) *base.Example

SetExample stores an example in components/examples if not already stored, and returns the $ref.

func (*Store) SetHeader

func (s *Store) SetHeader(name string, h *v3.Header) *v3.Header

SetHeader stores a header in components/headers if not already stored, and returns the $ref.

func (s *Store) SetLink(name string, l *v3.Link) *v3.Link

SetLink stores a link in components/links if not already stored, and returns the $ref.

func (*Store) SetParameter

func (s *Store) SetParameter(name string, p *v3.Parameter) *v3.Parameter

SetParameter stores a parameter in components/parameters if not already stored, and returns the $ref.

func (*Store) SetPathItem

func (s *Store) SetPathItem(name string, p *v3.PathItem) *v3.PathItem

SetPathItem stores a path item in components/pathItems if not already stored, and returns the $ref.

func (*Store) SetRequestBody

func (s *Store) SetRequestBody(name string, b *v3.RequestBody) *v3.RequestBody

SetRequestBody stores a request body in components/requestBodies if not already stored, and returns the $ref.

func (*Store) SetResponse

func (s *Store) SetResponse(name string, r *v3.Response) *v3.Response

SetResponse stores a response in components/responses if not already stored, and returns the $ref.

func (*Store) SetSchema

func (s *Store) SetSchema(t reflect.Type, name string, p *base.SchemaProxy) *base.SchemaProxy

SetSchema stores a schema for t in components/schemas if not already stored, and returns the $ref.

func (*Store) SetSecurityScheme

func (s *Store) SetSecurityScheme(name string, ss *v3.SecurityScheme) *v3.SecurityScheme

SetSecurityScheme stores a security scheme in components/securitySchemes if not already stored, and returns the $ref.

Jump to

Keyboard shortcuts

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