config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxMiddlewareGenerator added in v0.1.3

func CtxMiddlewareGenerator(config *Config) (mw func(http.Handler) http.Handler)

func GetMacondoConfig added in v0.1.3

func GetMacondoConfig(ctx context.Context) (*macondoconfig.Config, error)

Get the Macondo config from the context

Types

type ArgonConfig added in v0.1.3

type ArgonConfig struct {
	Time    int
	Memory  int
	Threads int
	Keylen  int
}

type Config

type Config struct {
	MacondoConfig macondoconfig.Config
	ArgonConfig   ArgonConfig

	DBConnString string
	ListenAddr   string
	SecretKey    string
	NatsURL      string
	MailgunKey   string
	RedisURL     string
	DiscordToken string
}

func (*Config) Load

func (c *Config) Load(args []string) error

Load loads the configs from the given arguments

type ConfigService added in v0.1.2

type ConfigService struct {
	// contains filtered or unexported fields
}

func NewConfigService added in v0.1.2

func NewConfigService(cs ConfigStore, userStore user.Store) *ConfigService

func (*ConfigService) GetAnnouncements added in v0.1.3

func (*ConfigService) GetUserDetails added in v0.1.3

func (cs *ConfigService) GetUserDetails(ctx context.Context, req *pb.UserRequest) (*pb.UserResponse, error)

func (*ConfigService) SetAnnouncements added in v0.1.3

func (cs *ConfigService) SetAnnouncements(ctx context.Context, req *pb.SetAnnouncementsRequest) (*pb.ConfigResponse, error)

func (*ConfigService) SetFEHash added in v0.1.3

func (cs *ConfigService) SetFEHash(ctx context.Context, req *pb.SetFEHashRequest) (*pb.ConfigResponse, error)

func (*ConfigService) SetGamesEnabled added in v0.1.2

func (cs *ConfigService) SetGamesEnabled(ctx context.Context, req *pb.EnableGamesRequest) (*pb.ConfigResponse, error)

func (*ConfigService) SetUserPermissions added in v0.1.3

func (cs *ConfigService) SetUserPermissions(ctx context.Context, req *pb.PermissionsRequest) (*pb.ConfigResponse, error)

type ConfigStore added in v0.1.2

type ConfigStore interface {
	SetGamesEnabled(context.Context, bool) error
	GamesEnabled(context.Context) (bool, error)

	SetFEHash(context.Context, string) error
	FEHash(context.Context) (string, error)

	SetAnnouncements(context.Context, []*pb.Announcement) error
	GetAnnouncements(context.Context) ([]*pb.Announcement, error)
}

type CtxKey added in v0.1.3

type CtxKey string
const CtxKeyword CtxKey = CtxKey("config")

Jump to

Keyboard shortcuts

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