server

package
v0.0.0-...-d724b4b Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompanyHandler

type CompanyHandler struct {
	CompanyStore CompanyStore
}

func NewCompanyHandler

func NewCompanyHandler(cs CompanyStore) *CompanyHandler

func (*CompanyHandler) Delete

func (ch *CompanyHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*CompanyHandler) Get

func (*CompanyHandler) GetMany

func (ch *CompanyHandler) GetMany(w http.ResponseWriter, r *http.Request)

func (*CompanyHandler) List

func (ch *CompanyHandler) List(w http.ResponseWriter, r *http.Request)

func (*CompanyHandler) Post

func (ch *CompanyHandler) Post(w http.ResponseWriter, r *http.Request)

type CompanyStore

type CompanyStore interface {
	Get(id int64) (company company.Company, ok bool, err error)
	List() (companies []company.Company, err error)
	Upsert(c company.Company) (id int64, err error)
	Delete(id int64) (err error)
}

type InMemoryCompanyStore

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

func NewInMemoryCompanyStore

func NewInMemoryCompanyStore() *InMemoryCompanyStore

func (*InMemoryCompanyStore) Delete

func (imcs *InMemoryCompanyStore) Delete(id int64) (err error)

func (*InMemoryCompanyStore) Get

func (imcs *InMemoryCompanyStore) Get(id int64) (c company.Company, ok bool, err error)

func (*InMemoryCompanyStore) List

func (imcs *InMemoryCompanyStore) List() (companies []company.Company, err error)

func (*InMemoryCompanyStore) Upsert

func (imcs *InMemoryCompanyStore) Upsert(c company.Company) (id int64, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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