photo_base

package
v0.0.0-...-7131128 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFile

type ConfigFile struct {
	Port     string `json:"port"`
	Host     string `json:"host"`
	DbHost   string `json:"dbhost"`
	DbPort   string `json:"dbport"`
	Password string `json:"password"`
	User     string `json:"user"`
	Name     string `json:"name"`
}

type Operation

type Operation struct {
	Id       int       `json:"id,omitempty"`
	Date     time.Time `json:"date"`
	Type     string    `json:"type"`
	PersonId int       `json:"personid"`
}

type OperationEndpoints

type OperationEndpoints interface {
	GetOperation(idParam string) func(w http.ResponseWriter, r *http.Request)

	CreateOperation() func(w http.ResponseWriter, r *http.Request)

	ListOperations() func(w http.ResponseWriter, r *http.Request)

	ListPersonOperations(idParam string) func(w http.ResponseWriter, r *http.Request)

	UpdateOperation(idParam string) func(w http.ResponseWriter, r *http.Request)

	DeleteOperation(personid string, operationid string) func(w http.ResponseWriter, r *http.Request)
}

func NewEndpointsOperationFactory

func NewEndpointsOperationFactory(operationStore OperationStore) OperationEndpoints

type OperationStore

type OperationStore interface {
	CreateOperation(operation *Operation) (*Operation, error)

	DeleteOperation(id int) error

	UpdateOperation(id int, operation *Operation) (*Operation, error)

	ListOperations() ([]*Operation, error)

	ListPersonOperations(id int) ([]*Operation, error)

	GetOperation(id int) (*Operation, error)
}

func NewPostgreOperationStore

func NewPostgreOperationStore(configfile *ConfigFile) (OperationStore, error)

type Person

type Person struct {
	Id          int       `json:"id,omitempty"`
	Name        string    `json:"name"`
	Surname     string    `json:"surname"`
	DateOfBirth time.Time `json:"dateofbirth"`
	Phone       string    `json:"phone"`
	City        string    `json:"city"`
	Comment     string    `json:"comment,omitempty"`
}

type PersonEndpoints

type PersonEndpoints interface {
	GetPerson(idParam string) func(w http.ResponseWriter, r *http.Request)

	CreatePerson() func(w http.ResponseWriter, r *http.Request)

	ListPersons() func(w http.ResponseWriter, r *http.Request)

	UpdatePerson(idParam string) func(w http.ResponseWriter, r *http.Request)

	DeletePerson(idParam string) func(w http.ResponseWriter, r *http.Request)
}

func NewEndpointsPersonFactory

func NewEndpointsPersonFactory(personStore PersonStore) PersonEndpoints

type PersonStore

type PersonStore interface {
	CreatePerson(person *Person) (*Person, error)

	DeletePerson(id int) error

	UpdatePerson(id int, person *Person) (*Person, error)

	ListPersons() ([]*Person, error)

	GetPerson(id int) (*Person, error)
}

func NewPostgrePersonStore

func NewPostgrePersonStore(configfile *ConfigFile) (PersonStore, error)

type Photo

type Photo struct {
	Id          int       `json:"id,omitempty"`
	Date        time.Time `json:"date"`
	OperationId int       `json:"operationid"`
	Status      int       `json:"status"`
	PersonId    int       `json:"personid"`
	FilePath    string
	Uid         string
}

type PhotoEndpoints

type PhotoEndpoints interface {
	GetPhoto(idParam string) func(w http.ResponseWriter, r *http.Request)

	CreatePhoto(personid string, operationid string) func(w http.ResponseWriter, r *http.Request)

	ListPhotos() func(w http.ResponseWriter, r *http.Request)

	ListPersonPhotos(idParam string) func(w http.ResponseWriter, r *http.Request)

	ListOperationPhotos(idParam string) func(w http.ResponseWriter, r *http.Request)

	UpdatePhoto(idParam string) func(w http.ResponseWriter, r *http.Request)

	DeletePhoto(idParam string) func(w http.ResponseWriter, r *http.Request)
}

func NewEndpointsPhotoFactory

func NewEndpointsPhotoFactory(photoStore PhotoStore) PhotoEndpoints

type PhotoStore

type PhotoStore interface {
	CreatePhoto(photo *Photo) (*Photo, error)

	GetPhoto(id int) (*Photo, error)

	ListPhotos() ([]*Photo, error)

	ListOperationPhotos(id int) ([]*Photo, error)

	ListPersonPhotos(id int) ([]*Photo, error)

	UpdatePhoto(id int, photo *Photo) (*Photo, error)

	DeletePhoto(id int) error
}

func NewPostgrePhotoStore

func NewPostgrePhotoStore(configfile *ConfigFile) (PhotoStore, error)

type User

type User struct {
	Id       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
	Role     int    `json:"role"`
}

Jump to

Keyboard shortcuts

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