di

package module
v0.0.0-...-9ddcead Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDatabase

func ConnectDatabase(config *Config) (*sql.DB, error)

Types

type Config

type Config struct {
	Enabled      bool
	DatabasePath string
	Port         string
}

func NewConfig

func NewConfig() *Config

type Person

type Person struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

type PersonRepository

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

func NewPersonRepository

func NewPersonRepository(database *sql.DB) *PersonRepository

func (*PersonRepository) FindAll

func (repository *PersonRepository) FindAll() []*Person

type PersonService

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

func NewPersonService

func NewPersonService(config *Config, repository *PersonRepository) *PersonService

func (*PersonService) FindAll

func (service *PersonService) FindAll() []*Person

type Server

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

func NewServer

func NewServer(config *Config, personService *PersonService) *Server

func (*Server) Handler

func (server *Server) Handler() http.Handler

func (*Server) Run

func (server *Server) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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