store

package
v0.0.0-...-9581e64 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgres

func NewPostgres(connection string) (*sqlx.DB, error)

Types

type CheckStore

type CheckStore interface {
	GetAndLockState(customerId, checkId string) (*checks.State, error)
	UpdateState(state *checks.State) error
	PutState(state *checks.State) error
	PutMemo(memo *checks.ResultMemo) error
	GetMemo(checkId, bastionId string) (*checks.ResultMemo, error)
	CreateStateTransitionLogEntry(checkId, customerId string, fromState, toState checks.StateId) (*checks.StateTransitionLogEntry, error)
	GetLiveBastions(customerId, checkId string) ([]string, error)
	GetCheckStateTransitionLogEntries(checkId, customerId string, from, to time.Time) ([]*checks.StateTransitionLogEntry, error)
	GetCheckStateTransitionLogEntry(checkId, customerId string, transitionId int64) (*checks.StateTransitionLogEntry, error)
	GetCheck(user *schema.User, checkId string) (*schema.Check, error)
	GetChecks(user *schema.User) ([]*schema.Check, error)
	GetCheckCount(customerId string) (int32, error)
}

func NewCheckStore

func NewCheckStore(q sqlx.Ext) CheckStore

type ListMeta

type ListMeta struct {
	Page    int
	PerPage int
	Total   uint64
}

type TeamStore

type TeamStore interface {
	WithTX(txfun func(TeamStore) error) error
	Get(id string) (*schema.Team, error)
	GetByStripeId(id string) (*schema.Team, error)
	GetUsers(id string) ([]*schema.User, error)
	GetInvites(id string) ([]*schema.User, error)
	Create(team *schema.Team) error
	Update(team *schema.Team) error
	UpdateSubscription(team *schema.Team) error
	Delete(team *schema.Team) error
	List(page, perPage int) ([]*schema.Team, ListMeta, error)
}

func NewTeamStore

func NewTeamStore(db *sqlx.DB) TeamStore

Jump to

Keyboard shortcuts

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