store

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
	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