restfulx

package module
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

chassix-restful

c5x.io/restful

Documentation

Index

Constants

View Source
const (
	KeyOpenAPITags = restfulSpec.KeyOpenAPITags

	SecurityDefinitionKey = "OAPI_SECURITY_DEFINITION"
)

Variables

This section is empty.

Functions

func AddMetaDataTags

func AddMetaDataTags(ws *restful.WebService, tags []string)

AddMetaDataTags add metadata tags to Webservice all routes

func Serve

func Serve(container *restful.Container, servIndex int)

Serve rest webservice index start from 1 func Serve(svc []*restful.WebService) {

func ServeDefault

func ServeDefault()

ServeDefault serve with default container and first server config

Types

type OpenAPIConfig

type OpenAPIConfig struct {
	Enabled  bool     `yaml:"enabled"`
	Host     string   `yaml:"host"`
	BasePath string   `yaml:"base_path"`
	Schemas  []string `yaml:"schemas"`
	Auth     string
	Spec     struct {
		Title       string
		Description string `yaml:"desc"`
		Contact     struct {
			Name  string
			Email string
			URL   string
		} `yaml:"contact"`
		License struct {
			Name string
			URL  string
		} `yaml:"license"`
		Version string
	}
	Tags []OpenapiTagConfig `yaml:",flow"`
	UI   OpenapiUIConfig    `yaml:"ui"`
}

OpenAPIConfig open api config

type OpenapiTagConfig

type OpenapiTagConfig struct {
	Name        string
	Description string `yaml:"desc"`
}

OpenapiTagConfig openapi tag

type OpenapiUIConfig

type OpenapiUIConfig struct {
	API        string `yaml:"api"`
	Dist       string `yaml:"dist"`
	Entrypoint string `yaml:"entrypoint"`
	External   string `yaml:"external"`
}

OpenapiUIConfig swagger ui config

type RestfulConfig

type RestfulConfig struct {
	OpenAPI OpenAPIConfig  `yaml:"openapi"`
	Servers []ServerConfig `yaml:"servers"`
}

type ServerConfig

type ServerConfig struct {
	Name        string
	Addr        string
	Description string
	OpenAPI     OpenAPIConfig `yaml:"openapi"`
}

ServerConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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