config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	AllowOrigins []string
}

type CallWrapper

type CallWrapper struct {
	APIType     string
	CallType    string
	TimeoutInMS int64
}

type ConsumerServer

type ConsumerServer struct {
	ProjectID     string
	AccessLogFile string
	ErrorLogFile  string
}

type CronServer

type CronServer struct {
	AccessLogFile string
	ErrorLogFile  string
}

type DBConfig

type DBConfig struct {
	SlaveDSN                 string        `json:"slave_dsn"`
	MasterDSN                string        `json:"master_dsn"`
	DirSchema                string        `json:"dir_schema"`
	MaxOpenConn              int           `json:"max_open_conn"`
	MaxIdleConn              int           `json:"max_idle_conn"`
	ConnectionMaxLifetime    time.Duration `json:"connection_max_lifetime"`
	TimeoutExceededInMinutes int           `json:"timeout_exceeded_in_minutes"`
}

type External

type External struct {
	Endpoint string
	Key      string
}

type Firestore

type Firestore struct {
	ProjectID string
}

type GrpcServer

type GrpcServer struct {
	Port                string
	AuthTimeoutInHour   int
	ContextTimeoutInSec int
	AccessLogFile       string
	ErrorLogFile        string
}

type JWT

type JWT struct {
	SignatureKey             string
	ExpDurationInHours       int
	ElapsedDurationInMinutes int
}

type PubSub

type PubSub struct {
	Topic    string
	IsActive bool
}

type Redis

type Redis struct {
	Address          string
	Username         string
	Password         string
	DB               int
	MinIdleConn      int
	MaxConnAgeInSec  int
	IdleTimeoutInSec int
}

type RestServer

type RestServer struct {
	Port          string
	Timeout       time.Duration
	AccessLogFile string
	ErrorLogFile  string
}

type Scheduler

type Scheduler struct {
	Schedule            string
	IsActive            bool
	IsDelayStillRunning bool
}

type ServiceConfig

type ServiceConfig struct {
	RestServer     RestServer
	GrpcServer     GrpcServer
	CronServer     CronServer
	ConsumerServer ConsumerServer
	Databases      map[string]*DBConfig
	Toggle         map[string]*Toggle
	External       map[string]*External
	CallWrapper    map[string]*CallWrapper
	Scheduler      map[string]*Scheduler
	Firestore      map[string]*Firestore
	PubSub         map[string]*PubSub
	CORS           CORS
	Redis          Redis
	JWT            JWT
}

func (*ServiceConfig) ReadConfig

func (serviceConfig *ServiceConfig) ReadConfig(module string)

ReadConfig read config file .ini

type Toggle

type Toggle struct {
	IsActive bool
}

Jump to

Keyboard shortcuts

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