conservation

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 NewConservationRepo

func NewConservationRepo(db *sql.DB) *conservationRepo

NewConservationRepo returns a struct that implements conservation repo with a database connection

func NewRouter

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

NewRouter returns a mux router

Types

type Conservation

type Conservation struct {
	ID      int    `json:"id,omitempty"`
	Created string `json:"created,omitempty"`
	// Sent is the number of day to keep the email in DB
	Sent int `json:"sent"`
	// Unsent is the number of day to keep unsent email in DB
	Unsent int `json:"unsent"`
	// KeepEmailContent will keep the body in DB
	KeepEmailContent bool `json:"keep_email_content"`
}

Conservation represea conservation rule

type ConservationRepo

type ConservationRepo interface {
	ListConservation() ([]*Conservation, error)
	GetConservation(id int) (*Conservation, error)
	DeleteConservation(id int) error
	InsertConservation(*Conservation) error
}

ConservationRepo is the interface to implements in order to manage conservation address

Jump to

Keyboard shortcuts

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