pkg

package
v0.0.0-...-cf7257f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenConnection

func OpenConnection(settings *Settings) (*sql.DB, error)

Types

type City

type City struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func NewCity

func NewCity(id int, name string) *City

type DataStore

type DataStore struct {
	// contains filtered or unexported fields
}

func NewDataStore

func NewDataStore(db *sql.DB) (*DataStore, error)

func (*DataStore) GetCities

func (ds *DataStore) GetCities() ([]*City, error)

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

func InitializeServer

func InitializeServer() (*HTTPServer, error)

func NewHTTPServer

func NewHTTPServer(settings *Settings, datastore *DataStore) *HTTPServer

func (*HTTPServer) Start

func (hs *HTTPServer) Start() error

type Settings

type Settings struct {
	Port int    `yaml:"port"`
	DSN  string `yaml:"dsn"`
}

func NewSettings

func NewSettings() *Settings

Jump to

Keyboard shortcuts

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