setup

package
v0.0.0-...-7360598 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccessors

func CreateAccessors(configLocation string) *setupCtx

CreateAccessors does initial setup and creates accessors to postgres, local/redis cache, battle.net, and discord.

func InitDB

func InitDB(c Config, cacheAccessor cache.ICache) *db.Accessor

InitDB established a database connection

func InitGlobalLogger

func InitGlobalLogger(c Config)

Types

type BnetAuthKeys

type BnetAuthKeys struct {
	ClientID     string
	ClientSecret string
	OAuthUrl     string
	ApiUrl       string
}

BnetAuthKeys stores credentials used for OAuth with battle.net, and the base url for sending all requests

type Config

type Config struct {
	Env                         string
	Patch                       model.RecipeVersion
	ValuationEnabled            bool
	HotItemTimeoutDays          int
	ShoppingListMaxItems        int
	DragonflightDefaultItemRank int
	DB                          struct {
		ConnString string
		ConnLimit  int
	}
	Cache struct {
		Type     string
		Addr     string
		Password string
		Database int
	}
	API  model.APIConfig
	Bnet BnetAuthKeys
	ADS  struct {
		Enabled  bool
		URL      string
		User     string
		Password string
	}
	Orch struct {
		URL      string
		User     string
		Password string
	}
}

Config contains settings for the bot

func Envs

func Envs(configLocation string) Config

Envs reads config files and env variables into a Config struct

Directories

Path Synopsis
api
Package model holds types and constants that don't fit in any other specific package, or are DAO functions
Package model holds types and constants that don't fit in any other specific package, or are DAO functions

Jump to

Keyboard shortcuts

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