app

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEnvConfiguration added in v0.4.1

func ApplyEnvConfiguration(config *Configuration)

ApplyEnvConfiguration applies the env variables on top of existing config

Types

type Configuration added in v0.4.1

type Configuration struct {
	ArticlesPerPage     int
	DatabasePath        string
	Description         string
	EnableCreate        bool
	EnableEdit          bool
	GoogleAnalyticsCode string
	Port                string
	Title               string
}

Configuration can be modified through environment variables

func DefaultConfiguration added in v0.4.1

func DefaultConfiguration() Configuration

DefaultConfiguration returns the default settings for the app

type Container

type Container struct {
	Configuration Configuration
	Db            Database
	Giphy         GiphyAdapter
	Version       string
}

Container Define the main container for the application

type Database

type Database interface {
	Close()
	Connect(dbFile string) error
	Exec(sql string, args ...interface{}) (sql.Result, error)
	Query(sql string, args ...interface{}) (rows.Rows, error)
}

Database Define same interface as database

type GiphyAdapter

type GiphyAdapter interface {
	SearchForID(s string) (string, error)
}

GiphyAdapter Interface for API

Directories

Path Synopsis
controller
web

Jump to

Keyboard shortcuts

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