apiserver

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(globalConfig *Config) *Api

todo : cache

func (*Api) Handle

func (a *Api) Handle(wg *sync.WaitGroup)

type ApiConfig

type ApiConfig struct {
	Driver                string
	Address               string
	Port                  int
	Username              string
	Password              string
	Database              string
	Tables                string
	Mapping               map[string]string
	Middlewares           map[string]map[string]interface{}
	Controllers           string
	CustomControllers     string
	CustomOpenApiBuilders string
	CacheType             string
	CachePath             string
	CacheTime             int32
	Debug                 bool
	BasePath              string
	OpenApiBase           map[string]interface{}
}

func (*ApiConfig) GetControllers

func (ac *ApiConfig) GetControllers() map[string]bool

public function getMiddlewares(): array

{
    return $this->values['middlewares'];
}

func (*ApiConfig) GetCustomControllers

func (ac *ApiConfig) GetCustomControllers() map[string]bool

func (*ApiConfig) GetCustomOpenApiBuilders

func (ac *ApiConfig) GetCustomOpenApiBuilders() map[string]bool

func (*ApiConfig) GetTables

func (ac *ApiConfig) GetTables() map[string]bool

public function getDriver(): string

{
    return $this->values['driver'];
}

public function getAddress(): string

{
    return $this->values['address'];
}

public function getPort(): int

{
    return $this->values['port'];
}

public function getUsername(): string

{
    return $this->values['username'];
}

public function getPassword(): string

{
    return $this->values['password'];
}

public function getDatabase(): string

{
    return $this->values['database'];
}

type Config

type Config struct {
	Api    *ApiConfig
	Server *ServerConfig
}

func ReadConfig

func ReadConfig(configPaths ...string) *Config

func (*Config) Init

func (c *Config) Init()

type ServerConfig

type ServerConfig struct {
	Address         string
	Http            bool
	HttpPort        int
	Https           bool
	HttpsPort       int
	HttpsCertFile   string
	HttpsKeyFile    string
	GracefulTimeout int
	WriteTimeout    int
	ReadTimeout     int
	IdleTimeout     int
}

Jump to

Keyboard shortcuts

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