opendoc

package
v0.0.3-2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Title              string                 `yaml:"title"`
	OpenapiRouter      string                 `yaml:"path"`
	OpenapiRedocRouter string                 `yaml:"redoc-path"`
	OpenapiUrl         string                 `yaml:"openapi-path"`
	OpenapiOpt         map[string]interface{} `yaml:"options"`
}

func DefaultCfg

func DefaultCfg() *Config

type Contact

type Contact = openapi3.Contact

type License

type License = openapi3.License

type Operation

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

func (*Operation) AddResponse added in v0.0.4

func (op *Operation) AddResponse(name string, resp interface{}) *Operation

func (*Operation) AddSecurity

func (op *Operation) AddSecurity(security ...security.Security) *Operation

func (*Operation) Openapi

func (op *Operation) Openapi() *openapi3.PathItem

func (*Operation) SetDescription

func (op *Operation) SetDescription(description string) *Operation

func (*Operation) SetExclude added in v0.0.4

func (op *Operation) SetExclude(exclude bool) *Operation

func (*Operation) SetModel

func (op *Operation) SetModel(req interface{}, rsp interface{}) *Operation

func (*Operation) SetOperation added in v0.0.4

func (op *Operation) SetOperation(operationID string) *Operation

func (*Operation) SetPath

func (op *Operation) SetPath(operationID string, path string) *Operation

func (*Operation) SetSummary

func (op *Operation) SetSummary(summary string) *Operation

type Server

type Server = openapi3.Server

type Servers

type Servers = openapi3.Servers

type Service

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

func (*Service) AddContentType

func (s *Service) AddContentType(contentType ...string) *Service

func (*Service) AddSecurity

func (s *Service) AddSecurity(security ...security.Security) *Service

func (*Service) DeleteOf

func (s *Service) DeleteOf(cb func(op *Operation)) *Service

func (*Service) GetOf

func (s *Service) GetOf(cb func(op *Operation)) *Service

func (*Service) Openapi

func (s *Service) Openapi() map[string]*openapi3.PathItem

func (*Service) PatchOf

func (s *Service) PatchOf(cb func(op *Operation)) *Service

func (*Service) PostOf

func (s *Service) PostOf(cb func(op *Operation)) *Service

func (*Service) PutOf

func (s *Service) PutOf(cb func(op *Operation)) *Service

func (*Service) SetPrefix

func (s *Service) SetPrefix(prefix string) *Service

type Swagger

type Swagger struct {
	Config         *Config
	Description    string
	Version        string
	TermsOfService string
	Routers        []*Service
	Servers        openapi3.Servers
	Contact        *openapi3.Contact
	License        *openapi3.License
	// contains filtered or unexported fields
}

func New

func New(handles ...func(swag *Swagger)) *Swagger

func (*Swagger) InitRouter

func (s *Swagger) InitRouter(r fiber.Router)

func (*Swagger) MarshalJSON

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

func (*Swagger) MarshalYAML

func (s *Swagger) MarshalYAML() ([]byte, error)

func (*Swagger) OpenapiDataHandler

func (s *Swagger) OpenapiDataHandler() fiber.Handler

func (*Swagger) ServiceOf

func (s *Swagger) ServiceOf(name string, cb func(srv *Service))

func (*Swagger) SetRootPath

func (s *Swagger) SetRootPath(path string)

Jump to

Keyboard shortcuts

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