store

package
v0.0.0-...-79fff4a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBastionRequest

type GetBastionRequest struct {
	ID    string
	State string
}

type GetBastionResponse

type GetBastionResponse struct {
	Bastion *com.Bastion
}

type ListBastionsRequest

type ListBastionsRequest struct {
	CustomerID string
	State      []string
}

type ListBastionsResponse

type ListBastionsResponse struct {
	Bastions []*com.Bastion
}

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func (*Postgres) GetBastion

func (pg *Postgres) GetBastion(request *GetBastionRequest) (*GetBastionResponse, error)

func (*Postgres) GetPendingTrackingStates

func (pg *Postgres) GetPendingTrackingStates(inactiveInterval string) (*TrackingStateResponse, error)

func (*Postgres) ListBastionStates

func (pg *Postgres) ListBastionStates(customers []string, filters ...*opsee.Filter) (*TrackingStateResponse, error)

func (*Postgres) ListBastions

func (pg *Postgres) ListBastions(request *ListBastionsRequest) (*ListBastionsResponse, error)

func (*Postgres) ListTrackingStates

func (pg *Postgres) ListTrackingStates(offset int, limit int) (*TrackingStateResponse, error)

func (*Postgres) PutBastion

func (pg *Postgres) PutBastion(bastion *com.Bastion) error

func (*Postgres) PutRegion

func (pg *Postgres) PutRegion(region *schema.Region) error

func (*Postgres) UpdateBastion

func (pg *Postgres) UpdateBastion(bastion *com.Bastion) error

func (*Postgres) UpdateTrackingSeen

func (pg *Postgres) UpdateTrackingSeen(bastionIDs []string, customerIDs []string) error

func (*Postgres) UpdateTrackingState

func (pg *Postgres) UpdateTrackingState(bastionID string, newState string) error

type Store

type Store interface {
	PutBastion(*com.Bastion) error
	UpdateBastion(*com.Bastion) error
	PutRegion(*schema.Region) error

	GetBastion(*GetBastionRequest) (*GetBastionResponse, error)
	ListBastions(*ListBastionsRequest) (*ListBastionsResponse, error)

	UpdateTrackingSeen([]string, []string) error
	GetPendingTrackingStates(string) (*TrackingStateResponse, error)
	ListTrackingStates(int, int) (*TrackingStateResponse, error)
	ListBastionStates([]string, ...*opsee.Filter) (*TrackingStateResponse, error)
	UpdateTrackingState(string, string) error
}

func NewPostgres

func NewPostgres(connection string) (Store, error)

type TrackingState

type TrackingState struct {
	ID         string    `json:"bastion_id"`
	CustomerID string    `json:"customer_id" db:"customer_id"`
	Status     string    `json:"current_state"`
	LastSeen   time.Time `json:"last_seen" db:"last_seen"`
	Region     string    `json:"region" db:"region"`
	VpcId      string    `json:"vpc_id" db:"vpc_id"`
}

type TrackingStateResponse

type TrackingStateResponse struct {
	States []*TrackingState
}

Jump to

Keyboard shortcuts

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