Documentation
¶
Overview ¶
Package storage store resource information
Package storage store resource information ¶
Package storage store resource information
Index ¶
- type Mock
- func (_m *Mock) Find(filter ResourceFilter) ([]resource.Resource, error)
- func (_m *Mock) GetRelations() ([]map[string]string, error)
- func (_m *Mock) GetResources() ([]resource.Resource, error)
- func (_m *Mock) Persist(resources []resource.Resource) error
- func (_m *Mock) Prepare() error
- func (_m *Mock) StoreRelations(relation config.Relation) error
- type PostgreSQL
- func (p *PostgreSQL) Find(filter ResourceFilter) ([]resource.Resource, error)
- func (p *PostgreSQL) GetRelations() ([]map[string]string, error)
- func (p *PostgreSQL) GetResources() ([]resource.Resource, error)
- func (p *PostgreSQL) Persist(resources []resource.Resource) error
- func (p *PostgreSQL) Prepare() error
- func (p *PostgreSQL) StoreRelations(relation config.Relation) error
- type Query
- type ResourceFilter
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock is an autogenerated mock type for the Storage type
func (*Mock) Find ¶
func (_m *Mock) Find(filter ResourceFilter) ([]resource.Resource, error)
Find provides a mock function with given fields: filter
func (*Mock) GetRelations ¶
GetRelations provides a mock function with given fields:
func (*Mock) GetResources ¶
GetResources provides a mock function with given fields:
type PostgreSQL ¶
PostgreSQL store storage configuration for PostgreSQL database
func (*PostgreSQL) Find ¶
func (p *PostgreSQL) Find(filter ResourceFilter) ([]resource.Resource, error)
Find resources based on criteria
func (*PostgreSQL) GetRelations ¶
func (p *PostgreSQL) GetRelations() ([]map[string]string, error)
GetRelations fetch all the relations between resources
func (*PostgreSQL) GetResources ¶
func (p *PostgreSQL) GetResources() ([]resource.Resource, error)
GetResources fetch all resources from storage
func (*PostgreSQL) Persist ¶
func (p *PostgreSQL) Persist(resources []resource.Resource) error
Persist store resources
func (*PostgreSQL) StoreRelations ¶
func (p *PostgreSQL) StoreRelations(relation config.Relation) error
StoreRelations will go through all resources in the database and based on criteria it will insert relationship to "relations" table StoreRelations will go through all resources in the database and based on criteria it will insert relationship to "relations" table
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query build query based on filters
type ResourceFilter ¶
ResourceFilter configure the filter
type Storage ¶
type Storage interface {
// Prepare to prepare the Storage schema
Prepare() error
// Persist Save resources to Storage
Persist(resources []resource.Resource) error
// Find will return the resources based on ResourceFilter
Find(filter ResourceFilter) ([]resource.Resource, error)
GetResources() ([]resource.Resource, error)
GetRelations() ([]map[string]string, error)
// StoreRelations Store Relationship
StoreRelations(relation config.Relation) error
}
Storage interface helps to build different storage
func BuildStorage ¶
BuildStorage build storage based on configuration