localconfig

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICredential

type APICredential struct {
	ClientID      string `yaml:"clientId"`
	ClientKey     string `yaml:"clientKey"`
	SecretKey     string `yaml:"secretKey"`
	CallbackToken string `yaml:"callbackToken"`
}

APICredential stores the credential used for connecting to an API service

type Config added in v1.2.0

type Config struct {
	Test   string `mapstructure:"name"`
	Xendit Xendit `mapstructure:"xendit"`
}

Config used to keep App Config.

func LoadConfig added in v1.2.0

func LoadConfig(path string) (*Config, error)

LoadConfig reads the file from path and return Secret

func LoadConfigFromBytes added in v1.2.0

func LoadConfigFromBytes(data []byte) (*Config, error)

LoadConfigFromBytes reads the secret file from data bytes

type DBCredential

type DBCredential struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	UserName string `yaml:"username"`
	Password string `yaml:"password"`
	DBName   string `yaml:"dbname"`
}

DBCredential stores database credential

type EWallet added in v1.2.0

type EWallet struct {
	LegacyEnabled bool          `mapstructure:"legacyEnabled"`
	OVO           EWalletConfig `mapstructure:"ovo"`
	Dana          EWalletConfig `mapstructure:"dana"`
	LinkAja       EWalletConfig `mapstructure:"linkaja"`
}

type EWalletConfig added in v1.2.0

type EWalletConfig struct {
	UseInvoice bool `mapstructure:"invoice"`
	UseLegacy  bool `mapstructure:"legacy"`
}

type PaymentSecret

type PaymentSecret struct {
	Midtrans APICredential `yaml:"midtrans"`
	Xendit   APICredential `yaml:"xendit"`
}

PaymentSecret stores secret for payment gateway

type Secret

type Secret struct {
	DB      DBCredential  `yaml:"db"`
	Payment PaymentSecret `yaml:"payment"`
}

Secret used to keep App Secret.

func LoadSecret

func LoadSecret(path string) (*Secret, error)

LoadSecret reads the file from path and return Secret

func LoadSecretFromBytes

func LoadSecretFromBytes(data []byte) (*Secret, error)

LoadSecretFromBytes reads the secret file from data bytes

type Xendit added in v1.2.0

type Xendit struct {
	EWallet EWallet `mapstructure:"ewallet"`
}

DBCredential stores database credential

Jump to

Keyboard shortcuts

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