Documentation ¶
Index ¶
- Variables
- func Env()
- type LoadEnv
- func (l LoadEnv) GetEnvBool(key string, lvl string, dVal bool) (bool, LoadEnv)
- func (l LoadEnv) GetEnvInt(key string, lvl string, dVal int) (int, LoadEnv)
- func (l LoadEnv) GetEnvString(key string, lvl string, dVal string) (string, LoadEnv)
- func (l LoadEnv) GetEnvStringList(key string, lvl string, dVal []string) ([]string, LoadEnv)
- func (l LoadEnv) Validate()
- type Mongo
- func (i *Mongo) Connect(dbName string) (r *Mongo)
- func (i *Mongo) CreateIndex(collection string, field string, unique bool)
- func (i *Mongo) FindOne(ctx context.Context, collection string, value bson.M, result interface{}) (err error)
- func (i Mongo) InsertOne(ctx context.Context, collection string, value interface{}) (err error)
- func (i *Mongo) LoadEnv() *Mongo
- type MongoError
- type Nats
Constants ¶
This section is empty.
Variables ¶
var HTTPBaseCookie http.Cookie
HTTPBaseCookie defines the base cookie setup for vcago
var Logger string
Logger defines the Logger type. Can set to IO for StdOut and NATS for nats logging
Functions ¶
Types ¶
type LoadEnv ¶ added in v1.0.1
type LoadEnv []bool
LoadEnv used for loading environment variables.
func (LoadEnv) GetEnvBool ¶ added in v1.0.1
GetEnvBool load a key from environment variables as bool.
func (LoadEnv) GetEnvInt ¶ added in v1.0.1
GetEnvInt loads a key from enviroment variables as int. The lvl param defines the log level. For warnings set "w" and for error set "e". If the variable is not used or can be ignored use n for do nothing. The default value can be set by the dVal param.
func (LoadEnv) GetEnvString ¶ added in v1.0.1
GetEnvString loads a key from enviroment variables as string. The lvl param defines the log level. For warnings set "w" and for error set "e". If the variable is not used or can be ignored use n for do nothing. The default value can be set by the dVal param.
func (LoadEnv) GetEnvStringList ¶ added in v1.0.1
GetEnvStringList as
type Mongo ¶ added in v1.0.1
Mongo represents the initial struct for an Mongo connection.
func (*Mongo) CreateIndex ¶ added in v1.0.1
type MongoError ¶ added in v1.0.1
type MongoError struct { Err string `json:"error" bson:"error"` Value interface{} `json:"value" bson:"value"` Database string `json:"database" bson:"database"` Collection string `json:"collection" bson:"collection"` }
func NewMongoError ¶ added in v1.0.1
func NewMongoError(err error, value interface{}, database string, collection string) *MongoError
func (*MongoError) Error ¶ added in v1.0.1
func (i *MongoError) Error() string