store

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API       = "api"
	Consul    = "consul"
	ETCD      = "etcd"
	File      = "file"
	Zookeeper = "zookeeper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	ID        string           `json:"id" db:"id" storm:"id"`
	Name      string           `json:"name" db:"name"`
	Order     int              `json:"order" db:"order"`
	Host      string           `json:"host" db:"host"`
	Path      string           `json:"path" db:"path"`
	Config    types.JSONText   `json:"config" db:"config"`
	Source    string           `json:"source,omitempty" db:"source"`
	CreatedAt time.Time        `json:"created_at" db:"created_at"`
	UpdatedAt time.Time        `json:"updated_at" db:"updated_at"`
	Raw       plugin.RawPlugin `json:"-" db:"-"`
	Unique    string           `json:"-" db:"-" storm:"unique"`
}

type Postgres

type Postgres struct {
	*sqlx.DB
}

func NewPostgres

func NewPostgres(uri string) (pg *Postgres)

func (*Postgres) AddPlugin

func (pg *Postgres) AddPlugin(p *Plugin) (err error)

func (*Postgres) Close

func (pg *Postgres) Close() error

func (*Postgres) DeleteBySource

func (pg *Postgres) DeleteBySource(source string) (err error)

func (*Postgres) FindPlugin

func (pg *Postgres) FindPlugin(id string) (p *Plugin, err error)

func (*Postgres) FindPlugins

func (pg *Postgres) FindPlugins() (plugins []*Plugin, err error)

func (*Postgres) UpdatePlugin

func (pg *Postgres) UpdatePlugin(p *Plugin) (err error)

type Store

type Store interface {
	AddPlugin(*Plugin) error
	FindPlugin(string) (*Plugin, error)
	FindPlugins() ([]*Plugin, error)
	UpdatePlugin(*Plugin) error
	DeleteBySource(source string) error
	Close() error
}

type Storm

type Storm struct {
	*storm.DB
}

func NewStorm

func NewStorm(uri string) (s *Storm, err error)

func (*Storm) AddPlugin

func (s *Storm) AddPlugin(p *Plugin) error

func (*Storm) Close

func (s *Storm) Close() error

func (*Storm) DeleteBySource

func (s *Storm) DeleteBySource(source string) (err error)

func (*Storm) FindPlugin

func (s *Storm) FindPlugin(id string) (p *Plugin, err error)

func (*Storm) FindPlugins

func (s *Storm) FindPlugins() (plugins []*Plugin, err error)

func (*Storm) UpdatePlugin

func (s *Storm) UpdatePlugin(p *Plugin) error

Jump to

Keyboard shortcuts

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