config

package
v0.0.0-...-e8da0a6 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APPName     string            `yaml:"appName" default:"flow-api"`
	HttpService Http              `yaml:"http"`
	GrpcService Grpc              `yaml:"grpc"`
	Database    Database          `yaml:"database"`
	Migrate     Migrate           `yaml:"migrate"`
	Enigma      enigma.Config     `yaml:"enigma"`
	Logger      logger.ZaprConfig `yaml:"logger"`
}

func New

func New(c *Config, configPath string) (*Config, error)

type Database

type Database struct {
	Type            string `yaml:"type"            default:"mysql"`
	Protocol        string `yaml:"protocol"        default:"tcp"`
	Host            string `yaml:"host"            default:"localhost"`
	Port            string `yaml:"port"            default:"3306"`
	DBName          string `yaml:"dbname"          default:"flow"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	MaxOpenConns    int    `yaml:"maxOpenConns"    default:"15"`
	MaxIdleConns    int    `yaml:"maxIdleConns"    default:"5"`
	ConnMaxLifetime int    `yaml:"connMaxLifetime" default:"1"`
}

type Grpc

type Grpc struct {
	Port           int32 `yaml:"port"           default:"18099"`
	Tls            Tls   `yaml:"tls"`
	MaxRecvMsgSize int   `yaml:"maxRecvMsgSize" default:"1073741824"` // 1GiB
}

type Http

type Http struct {
	Port      int32                 `yaml:"port"      default:"8099"`
	URLPrefix string                `yaml:"urlPrefix" default:""`
	Tls       Tls                   `yaml:"tls"`
	CORS      middleware.CORSConfig `yaml:"cors"`
}

type Migrate

type Migrate struct {
	Source string `yaml:"source" default:"migrations/mysql"`
}

type Tls

type Tls struct {
	Enable   bool   `yaml:"enable"   default:"false"`
	CertFile string `yaml:"certFile" default:"server.crt"`
	KeyFile  string `yaml:"keyFile"  default:"server.key"`
}

Jump to

Keyboard shortcuts

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