restfulx

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

chassix-restful

c5x.io/restful

Documentation

Index

Constants

View Source
const (
	// KeyOpenAPITags is a Metadata key for a restful Route
	KeyOpenAPITags        = restfulSpec.KeyOpenAPITags
	SecurityDefinitionKey = "OAPI_SECURITY_DEFINITION"
)

Variables

This section is empty.

Functions

func AddJwtAuth added in v0.2.1

func AddJwtAuth(ws *restful.WebService, ff restful.FilterFunction)

AddJwtAuth add metadata tags to Webservice all routes

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 OAISecurity added in v0.2.0

type OAISecurity struct {
	Name   string   // SecurityDefinition name
	Scopes []string // Scopes for oauth2
}

func (*OAISecurity) Valid added in v0.2.0

func (s *OAISecurity) Valid() error

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