config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 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:""`
	FirebaseProjectID  string `split_words:"true" default:""`
}

Firebase type

func NewFirebase

func NewFirebase(set Set) Firebase

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
	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 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 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
	PubSub    PubSub
	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