config

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromEnv

func LoadFromEnv(pointer ...interface{}) error

Types

type Cassandra

type Cassandra struct {
	CassandraKeySpace          string        `split_words:"true" default:"test"`
	CassandraPort              string        `split_words:"true" default:"9042"`
	CassandraHosts             []string      `split_words:"true" default:"127.0.0.1"`
	CassandraForcePassword     bool          `split_words:"true" default:"false"`
	CassandraUsername          string        `split_words:"true" default:"cassandra"`
	CassandraPassword          string        `split_words:"true" default:"cassandra"`
	CassandraTimeout           time.Duration `split_words:"true" default:"600s"`
	CassandraConnectionTimeout time.Duration `split_words:"true" default:"600s"`
	ReconnectInterval          time.Duration `split_words:"true" default:"60s"`
	CassandraNumConnection     int           `split_words:"true" default:"5"`
	DisableInitialHostLookup   bool          `split_words:"true" default:"false"`
}

Cassandra type

func NewCassandra

func NewCassandra(set Set) Cassandra

type Cloud

type Cloud struct {
	ProjectID             string `split_words:"true" default:"test-project"`
	EndPoint              string `split_words:"true" default:"localhost:9010"`
	WithoutAuthentication bool   `split_words:"true" default:"true"`
	GRPCInsecure          bool   `split_words:"true" default:"true"`
}

Cloud type

func NewCloud

func NewCloud(set Set) Cloud

type Cockroach

type Cockroach struct {
	CockroachUsername  string        `split_words:"true" default:"root"`
	CockroachPassword  string        `split_words:"true" default:""`
	CockroachHost      string        `split_words:"true" default:"localhost"`
	CockroachPort      string        `split_words:"true" default:"26257"`
	CockroachDatabase  string        `split_words:"true" default:"defaultdb"`
	CockroachSSLMode   string        `split_words:"true" default:"disable"`
	CockroachURL       string        `split_words:"true" default:"postgres://root@localhost:26257/defaultdb?sslmode=disable"`
	CockroachTxTimeout time.Duration `split_words:"true" default:"5s"`
}

Cockroach type

func NewCockroach

func NewCockroach(set Set) Cockroach

type Core

type Core struct {
	LoggerMode string `split_words:"true" default:"customized"`
	SystemName string `split_words:"true" default:"system"`
}

Core type

func NewCore

func NewCore(set Set) Core

type Firebase

type Firebase struct {
	FirebaseConfigJSON       string `split_words:"true" default:""`
	FirebaseConfigJSONBase64 string `split_words:"true" default:""`
	FirebaseProjectID        string `split_words:"true" default:""`
}

Firebase type

func NewFirebase

func NewFirebase(set Set) Firebase

type Firestore added in v0.0.8

type Firestore struct {
	ProjectID string `split_words:"true" default:""`
	EndPoint  string `split_words:"true" default:""`
}

Firestore type

type GRPC

type GRPC struct {
	Port                         string        `split_words:"true" default:"38080"`
	NoTLS                        bool          `split_words:"true" default:"true"`  // use WithInsecure option
	SkipTLS                      bool          `split_words:"true" default:"false"` // use WithTransportCredentials option and include InsecureSkipVerify=true
	TLS                          bool          `split_words:"true" default:"false"` // use WithTransportCredentials option and include PemCert
	TLSNil                       bool          `split_words:"true" default:"false"` // use WithTransportCredentials option and include Use RootCA
	TLSPemCert                   string        `split_words:"true" default:"false"` // TLS PemCert data
	TLSPemCertBase64             string        `split_words:"true" default:"false"` // TLS PemCert base64encode data
	ALTS                         bool          `split_words:"true" default:"false"` // client use grpc.WithTransportCredentials(alts.NewClientCreds(alts.DefaultClientOptions())); server use grpc.Creds(alts.NewServerCreds(alts.DefaultServerOptions()))
	KeepAliveTime                time.Duration `split_words:"true" default:"1s"`    // second
	KeepAliveTimeout             time.Duration `split_words:"true" default:"20s"`   //second
	KeepAlivePermitWithoutStream bool          `split_words:"true" default:"true"`
	AllowedList                  []string      `split_words:"true" default:"/auth.Auth/Ping,/auth.Auth/Authorization"`
}

GRPC type

func NewGRPC

func NewGRPC(set Set) GRPC

type JWT

type JWT struct {
	MetadataClientIDKey string `split_words:"true" default:"authorization-clientID"`
	EcdsaPrivateKeyPath string `split_words:"true" default:"./es256_private.pem"`
	EcdsaPrivateKey     string `split_words:"true" default:""`
	RsaPrivateKeyPath   string `split_words:"true" default:"./rs256-private.pem"`
	RsaPrivateKey       string `split_words:"true" default:""`
	HmacSecretKeyPath   string `split_words:"true" default:"./hs-secret.pem"`
	HmacSecretKey       string `split_words:"true" default:""`
}

JWT type

func NewJWT

func NewJWT(set Set) JWT

type Mongo added in v0.0.14

type Mongo struct {
	MongoProtocol          string `split_words:"true" default:"mongodb+srv"`
	MongoUsername          string `split_words:"true" default:""`
	MongoPassword          string `split_words:"true" default:""`
	MongoHost              string `split_words:"true" default:""`
	MongoDatabase          string `split_words:"true" default:""`
	MongoAuthSource        bool   `split_words:"true" default:""`
	MongoIgnoreQueryString bool   `split_words:"true" default:""`
}

Mongo type

func NewMongo added in v0.0.14

func NewMongo(set Set) Mongo

type Postgres added in v0.0.12

type Postgres struct {
	PostgresUsername  string        `split_words:"true" default:"postgres"`
	PostgresPassword  string        `split_words:"true" default:"postgres"`
	PostgresHost      string        `split_words:"true" default:"localhost"`
	PostgresPort      string        `split_words:"true" default:"5432"`
	PostgresDatabase  string        `split_words:"true" default:"postgres"`
	PostgresSSLMode   string        `split_words:"true" default:"disable"`
	PostgresURL       string        `split_words:"true" default:"postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"`
	PostgresTxTimeout time.Duration `split_words:"true" default:"5s"`
}

Postgres type

func NewPostgres added in v0.0.12

func NewPostgres(set Set) Postgres

type Postgresql added in v0.0.11

type Postgresql struct {
	PostgresqlUsername  string        `split_words:"true" default:"root"`
	PostgresqlPassword  string        `split_words:"true" default:""`
	PostgresqlHost      string        `split_words:"true" default:"localhost"`
	PostgresqlPort      string        `split_words:"true" default:"26257"`
	PostgresqlDatabase  string        `split_words:"true" default:"defaultdb"`
	PostgresqlSSLMode   string        `split_words:"true" default:"disable"`
	PostgresqlURL       string        `split_words:"true" default:"postgres://root@localhost:26257/defaultdb?sslmode=disable"`
	PostgresqlTxTimeout time.Duration `split_words:"true" default:"5s"`
}

Postgresql type

type PubSub added in v0.0.2

type PubSub struct {
	ProjectID             string `split_words:"true" default:"test-project"`
	EndPoint              string `split_words:"true" default:"localhost:9010"`
	WithoutAuthentication bool   `split_words:"true" default:"true"`
	GRPCInsecure          bool   `split_words:"true" default:"true"`
}

PubSub type

func NewPubSub added in v0.0.2

func NewPubSub(set Set) PubSub

type Redis added in v0.0.12

type Redis struct {
	RedisUsername   string `split_words:"true" default:""`
	RedisPassword   string `split_words:"true" default:""`
	RedisClientName string `split_words:"true" default:""`
	RedisHost       string `split_words:"true" default:"localhost"`
	RedisPort       string `split_words:"true" default:"6379"`
	RedisPoolSize   int    `split_words:"true" default:"10"`
}

Redis type

func NewRedis added in v0.0.12

func NewRedis(set Set) Redis

type Server

type Server struct {
	ReleaseMode          bool          `split_words:"true" default:"true"`
	Port                 string        `split_words:"true" default:"38080"`
	MetricsPort          string        `split_words:"true" default:"38090"`
	ServerTimeout        time.Duration `split_words:"true" default:"5s"`
	PrefixMessage        string        `split_words:"true" default:"error gin server"`
	CustomizedRender     bool          `split_words:"true" default:"false"`
	AllowAllOrigins      bool          `split_words:"true" default:"false"`
	AllowOrigins         []string      `split_words:"true" default:"http://localhost,https://localhost"`
	AllowedPaths         []string      `split_words:"true" default:"/favicon.ico,/ping,/metrics,/api/auth/v1/authorization,/narrow_cast_schedule"`
	JWTGuard             bool          `split_words:"true" default:"true"`
	MaxMultipartMemoryMB int64         `split_words:"true" default:"8"`
}

Server type

func NewServer

func NewServer(set Set) Server

type Set

type Set struct {
	Cassandra Cassandra
	Cloud     Cloud
	Cockroach Cockroach
	Core      Core
	Firebase  Firebase
	GRPC      GRPC
	JWT       JWT
	Mongo     Mongo
	PubSub    PubSub
	Postgres  Postgres
	Redis     Redis
	Server    Server
	Spanner   Spanner
}

func NewSet

func NewSet() (Set, error)

type Spanner

type Spanner struct {
	ProjectID             string `split_words:"true" default:"test-project"`
	Instance              string `split_words:"true" default:"test-instance"`
	Database              string `split_words:"true" default:"test-database"`
	EndPoint              string `split_words:"true" default:"localhost:9010"`
	WithoutAuthentication bool   `split_words:"true" default:"true"`
	GRPCInsecure          bool   `split_words:"true" default:"true"`
}

Spanner type

func NewSpanner

func NewSpanner(set Set) Spanner

Jump to

Keyboard shortcuts

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