config

package
v1.0.151 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 10 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 {
	Name string `json:"name"`
	Host string `json:"host"`
	Port int    `json:"port"`
	Path string `json:"path"`

	Swagger Swagger  `json:"swagger"`
	Cors    Cors     `json:"cors"`
	Https   Https    `json:"https"`
	Gateway Gateway  `json:"gateway"`
	Dbs     []string `json:"dbs"`
	Ativo   bool     `json:"ativo"`
}

func (*Api) GetPortStr

func (a *Api) GetPortStr() string

type Bot

type Bot struct {
	Name  string   `json:"name"`
	Dbs   []string `json:"dbs"`
	Ativo bool     `json:"ativo"`
}

type Cert

type Cert struct {
	Name         string
	Ativo        bool
	Path_crt     string
	Path_private string
	Pass         string
}

type Certs

type Certs []*Cert

func (*Certs) GetCert

func (c *Certs) GetCert(value string) (bool, *Cert)

type Config

type Config struct {
	Dbs      []*Database `json:"dbs"`
	Services []*Service  `json:"services"`
	Bots     []*Bot      `json:"bots"`
	Apis     []*Api      `json:"apis"`
	Jwt      []*Jwt      `json:"jwt"`
	Parans   Params      `json:"parans"`
	Certs    Certs       `json:"certs"`
	Log      Log         `json:"log"`
	Path     string      `json:"path"`
	JsonFile string
}
var InstanceConfig *Config

func NewConfig

func NewConfig() *Config

func (*Config) AddApi

func (c *Config) AddApi(api Api)

func (*Config) AddDb

func (c *Config) AddDb(db Database)

func (*Config) AddService

func (c *Config) AddService(service Service)

func (*Config) GetApi

func (c *Config) GetApi(name string) (bool, *Api)

func (*Config) GetBot

func (c *Config) GetBot(name string) (bool, *Bot)

func (*Config) GetCert

func (c *Config) GetCert(name string) (bool, *Cert)

func (*Config) GetDB

func (c *Config) GetDB(name string) (bool, *Database)

func (*Config) GetJwt added in v1.0.144

func (c *Config) GetJwt(name string) (bool, *Jwt)

func (*Config) GetService

func (c *Config) GetService(name string) (bool, *Service)

func (*Config) RemoveApi

func (c *Config) RemoveApi(api Api)

func (*Config) RemoveDb

func (c *Config) RemoveDb(db Database)

func (*Config) RemoveService

func (c *Config) RemoveService(service Service)

func (*Config) Save

func (c *Config) Save() error

type Cors

type Cors struct {
	MaxAge           int      `json:"maxAge"`
	AllowCredentials bool     `json:"allowCredentials"`
	AllowHeaders     []string `json:"allowHeaders"`
	ExposedHeaders   []string `json:"exposedHeaders"`
	AllowMethods     []string `json:"allowMethods"`
	AllowOrigins     []string `json:"allowOrigins"`
	Ativo            bool     `json:"ativo"`
}

type Database

type Database struct {
	Name     string `json:"name"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Pass     string `json:"pass"`
	Schema   string `json:"schema"`
	Sid      string `json:"sid"`
	PoolSize int    `json:"poolsize"`
	MaxConn  int    `json:"maxconn"`
	Ativo    bool   `json:"ativo"`
	Trace    Trace  `json:"trace"`
	Db       string `json:"db"`
}

func (Database) GetDsn

func (d Database) GetDsn() string

type Gateway

type Gateway struct {
	Protocolo string `json:"protocolo"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
	Ativo     bool   `json:"ativo"`
}

type Https

type Https struct {
	Cert     string    `json:"cert"`
	Key      string    `json:"key"`
	Validate time.Time `json:"validate"`
	Ativo    bool      `json:"ativo"`
}

type Jwt added in v1.0.143

type Jwt struct {
	Name           string `json:"name"`
	ExpirationTime int    `json:"expirationTime"`
	SecretKey      string `json:"secret"`
}

type Log added in v1.0.143

type Log struct {
	Nivel  int  `json:"nivel"`
	Screen bool `json:"screen"`
}

type Param

type Param struct {
	Marcador string
	Name     string
	Value    string
}

type Params

type Params []*Param

func (*Params) GetParam

func (p *Params) GetParam(Marcador, Name string) (bool, string)

type Service

type Service struct {
	Name  string   `json:"name"`
	Dbs   []string `json:"dbs"`
	Ativo bool     `json:"ativo"`
}

type Swagger

type Swagger struct {
	AuthJwt bool `json:"authJwt"`
	Ativo   bool `json:"ativo"`
}

type Trace

type Trace struct {
	Path  string `json:"path"`
	Ativo bool   `json:"ativo"`
}

Jump to

Keyboard shortcuts

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