localconfig

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 5 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 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 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

Jump to

Keyboard shortcuts

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