config

package
v0.0.0-...-698a90b Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEV  = "dev"
	PROD = "prod"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	General GeneralConfig
	Notion  NotionConfig
}

Config is a service that is designed to provide various configuration to the rest of the application.

type GeneralConfig

type GeneralConfig struct {
	AppEnv string // the environment that the application is running in (dev, prod, etc)
}

GeneralConfig contains general information the application

type New

type New struct{}

New ...

func (*New) Get

func (n *New) Get() Config

Get ...

func (*New) Load

func (n *New) Load()

Load will load the config

type NotionConfig

type NotionConfig struct {
	IntegrationToken string // integration token
	DatabaseID       string // database ID
}

NotionConfig contains information that the Notion API needs to run

type Service

type Service interface {
	// Load will do any config setup (like load env vars)
	Load()
	// Get will get the config
	Get() Config
}

Service is an interface that defines the functions needed to implement a Config Service.

Jump to

Keyboard shortcuts

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