conf

package
v1.10.15 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(g model.Generator) (err error)

Types

type Auth

type Auth struct {
	Encoding interface{}
}

type AuthJWTEncoding

type AuthJWTEncoding struct {
	Method      string   `yaml:"method,omitempty"`
	SK          string   `yaml:"sk,omitempty"`
	PublicKey   string   `yaml:"publicKey,omitempty"`
	PrivateKey  string   `yaml:"privateKey,omitempty"`
	Issuer      string   `yaml:"issuer,omitempty"`
	Audience    []string `yaml:"audience,omitempty"`
	Expirations string   `yaml:"expirations,omitempty"`
}

type Cluster

type Cluster struct {
	DevMode           bool                   `yaml:"devMode"`
	NodesProxyAddress string                 `yaml:"nodesProxyAddress"`
	Kind              string                 `yaml:"kind,omitempty"`
	Client            ClusterClient          `yaml:"client,omitempty"`
	Options           map[string]interface{} `yaml:"options,omitempty"`
}

type ClusterClient

type ClusterClient struct {
	MaxIdleConnSeconds    int `yaml:"maxIdleConnSeconds,omitempty"`
	MaxConnsPerHost       int `yaml:"maxConnsPerHost,omitempty"`
	MaxIdleConnsPerHost   int `yaml:"maxIdleConnsPerHost,omitempty"`
	RequestTimeoutSeconds int `yaml:"requestTimeoutSeconds,omitempty"`
}

type Config

type Config struct {
	Name           string     `yaml:"name,omitempty"`
	Runtime        *Runtime   `yaml:"runtime,omitempty"`
	Log            *LogConfig `yaml:"log,omitempty"`
	OAS            *OAS       `yaml:"oas,omitempty"`
	Server         *Server    `yaml:"server,omitempty"`
	Cluster        *Cluster   `yaml:"cluster,omitempty"`
	Authorizations *Auth      `yaml:"authorizations,omitempty"`
	SQL            *SQL       `yaml:"sql,omitempty"`
}

type Cors

type Cors struct {
	AllowedOrigins   []string `yaml:"allowedOrigins,omitempty"`
	AllowedHeaders   []string `yaml:"allowedHeaders,omitempty"`
	ExposedHeaders   []string `yaml:"exposedHeaders,omitempty"`
	AllowCredentials bool     `yaml:"allowCredentials,omitempty"`
	MaxAge           int      `yaml:"maxAge,omitempty"`
}

type LogConfig

type LogConfig struct {
	Level     string `yaml:"level,omitempty"`
	Formatter string `yaml:"formatter,omitempty"`
	Color     bool   `yaml:"color,omitempty"`
}

type OAS

type OAS struct {
	Title       string      `yaml:"title,omitempty"`
	Description string      `yaml:"description,omitempty"`
	Terms       string      `yaml:"terms,omitempty"`
	Contact     *OASContact `yaml:"contact,omitempty"`
	License     *OASLicense `yaml:"license,omitempty"`
	Servers     []OASServer `yaml:"servers,omitempty"`
}

type OASContact

type OASContact struct {
	Name  string `yaml:"name,omitempty"`
	Url   string `yaml:"url,omitempty"`
	Email string `yaml:"email,omitempty"`
}

type OASLicense

type OASLicense struct {
	Name string `yaml:"name,omitempty"`
	Url  string `yaml:"url,omitempty"`
}

type OASServer

type OASServer struct {
	URL         string `yaml:"url,omitempty"`
	Description string `yaml:"description,omitempty"`
}

type Runtime added in v1.10.4

type Runtime struct {
	MaxWorkers           int `yaml:"maxWorkers"`
	WorkerMaxIdleSeconds int `yaml:"workerMaxIdleSeconds"`
	HandleTimeoutSeconds int `yaml:"handleTimeoutSeconds"`
}

type SQL added in v1.10.0

type SQL struct {
	Driver           string   `yaml:"driver"`
	MasterSlaverMode bool     `yaml:"masterSlaverMode"`
	DSN              []string `yaml:"dsn"`
	MaxIdles         int      `yaml:"maxIdles"`
	MaxOpens         int      `yaml:"maxOpens"`
	EnableDebugLog   bool     `yaml:"enableDebugLog"`
	GTMCleanUpSecond int      `yaml:"gtmCleanUpSecond"`
	Isolation        int      `yaml:"isolation"`
}

type Server

type Server struct {
	Port         int                        `yaml:"port,omitempty"`
	Cors         *Cors                      `yaml:"cors,omitempty"`
	TLS          *TLS                       `yaml:"tls,omitempty"`
	Options      json.RawMessage            `yaml:"options,omitempty"`
	Interceptors map[string]json.RawMessage `yaml:"interceptors,omitempty"`
}

type TLS

type TLS struct {
	// Kind
	// ACME
	// SSC(SELF-SIGN-CERT)
	// DEFAULT
	Kind    string          `yaml:"kind,omitempty"`
	Options json.RawMessage `yaml:"options,omitempty"`
}

Jump to

Keyboard shortcuts

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