Documentation ¶
Index ¶
- type Postgres
- func (db *Postgres) EmptyStorage() error
- func (db *Postgres) GetServiceGroups(sortField string, sortAsc bool, page int32, pageSize int32, ...) ([]*storage.ServiceGroupDisplay, error)
- func (db *Postgres) GetServiceGroupsHealthCounts() (*storage.HealthCounts, error)
- func (db *Postgres) GetServices(sortField string, sortAsc bool, page int32, pageSize int32, ...) ([]*storage.Service, error)
- func (db *Postgres) GetServicesHealthCounts(filters map[string][]string) (*storage.HealthCounts, error)
- func (db *Postgres) IngestHabEvent(event *applications.HabService) error
- func (db *Postgres) IngestHabEventWithoutMetrics(event *applications.HabService) error
- func (db *Postgres) ServiceGroupExists(id string) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
Postgres is a wrapping struct that will hold the database mapping object from the underlying db/sql implementation (gorp) plus our service config specifically for storage.
Additionally this struct implements our storage.Client interface
func (*Postgres) EmptyStorage ¶
EmptyStorage deletes all the data from the database @afiune This function is only used by our Integration Test framework
func (*Postgres) GetServiceGroups ¶
func (db *Postgres) GetServiceGroups( sortField string, sortAsc bool, page int32, pageSize int32, filters map[string][]string) ([]*storage.ServiceGroupDisplay, error)
getServiceFromUniqueFields retrieve a service from the db without the need of an id
func (*Postgres) GetServiceGroupsHealthCounts ¶
func (db *Postgres) GetServiceGroupsHealthCounts() (*storage.HealthCounts, error)
GetServiceGroupsHealthCounts retrieves the health counts from all service groups in the database
func (*Postgres) GetServices ¶
func (db *Postgres) GetServices( sortField string, sortAsc bool, page int32, pageSize int32, filters map[string][]string, ) ([]*storage.Service, error)
GetServices returns a list of services
func (*Postgres) GetServicesHealthCounts ¶
func (db *Postgres) GetServicesHealthCounts(filters map[string][]string) (*storage.HealthCounts, error)
GetServicesHealthCounts retrieves the health counts from all services in the database. This function accepts a set of filters that can be applied to the SQL query to get the health counts of a subset of the services in the database
func (*Postgres) IngestHabEvent ¶
func (db *Postgres) IngestHabEvent(event *applications.HabService) error
IngestHabEvents process habitat events and store them into the database
func (*Postgres) IngestHabEventWithoutMetrics ¶
func (db *Postgres) IngestHabEventWithoutMetrics(event *applications.HabService) error
IngestHabEvents process habitat events and store them into the database