infra

package
v0.0.0-...-52b9301 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPrefix = "APP"
)

Variables

This section is empty.

Functions

func LoadTemplate

func LoadTemplate(cfg *Config) *template.Template

func NewGSheetService

func NewGSheetService(cfg *Config) (*sheets.Service, error)

func NewServer

func NewServer(cfg *Config, tmpl *template.Template) *echo.Echo

Types

type Config

type Config struct {
	Address      string        `envconfig:"ADDRESS" default:":8089" required:"true"`
	ReadTimeout  time.Duration `envconfig:"READ_TIMEOUT" default:"5s"`
	WriteTimeout time.Duration `envconfig:"WRITE_TIMEOUT" default:"10s"`
	Debug        bool          `envconfig:"DEBUG" default:"true"`
	Pages        string        `envconfig:"PAGES" default:"web/template/*.gohtml"`

	GSheet struct {
		CredPath string `envconfig:"CRED_PATH" default:"service-account.json" required:"true"`
	}
}

func LoadAppConfig

func LoadAppConfig() (*Config, error)

Directories

Path Synopsis
dependency injection package
dependency injection package

Jump to

Keyboard shortcuts

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