entity

package
v0.0.0-...-8ac8335 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEntityRepo

func NewEntityRepo(db *sql.DB) *entityRepo

NewEntityRepo returns a struct that implements entity repo with a database connection

func NewRouter

func NewRouter(db *sql.DB) *chi.Mux

NewRouter returns a mux router

Types

type Entity

type Entity struct {
	Id int `json:"id,omitempty"`
	// Name is the entity address
	Name           string `json:"name"`
	Created        string `json:"created,omitempty"`
	Description    string `json:"description,omitempty"`
	ConservationID int    `json:"conservation_id"`
	AbuseID        int    `json:"abuse_id"`
}

Entity represents an entity

type EntityRepo

type EntityRepo interface {
	ListEntity() ([]*Entity, error)
	GetEntity(id int) (*Entity, error)
	DeleteEntity(id int) error
	InsertEntity(*Entity) error
}

EntityRepo is the interface to implements in order to manage entity address

Jump to

Keyboard shortcuts

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