templates

package
v0.0.0-...-4c1e4d6 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

type Template struct {
	ID        int       `json:"id,omitempty"`
	Query     string    `json:"query,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

func (*Template) Valid

func (t *Template) Valid() error

type TemplateHandler

type TemplateHandler struct {
	Store    *TemplateStore
	Logger   *log.Logger
	PageSize int
}

func (*TemplateHandler) ServeHTTP

func (h *TemplateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TemplateStore

type TemplateStore struct {
	*sqlx.DB
}

func (TemplateStore) CreateTemplate

func (store TemplateStore) CreateTemplate(t *Template) (*Template, error)

func (TemplateStore) DeleteTemplate

func (store TemplateStore) DeleteTemplate(id int) error

func (TemplateStore) GetTemplate

func (store TemplateStore) GetTemplate(id int) (*Template, error)

func (TemplateStore) ListTemplates

func (store TemplateStore) ListTemplates(perPage int, lastId int) (*[]Template, error)

func (TemplateStore) UpdateTemplate

func (store TemplateStore) UpdateTemplate(t *Template) (*Template, error)

Jump to

Keyboard shortcuts

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