multistore

package
v0.0.0-...-0184392 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: AGPL-3.0, AGPL-3.0-or-later Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardsStore

type DashboardsStore struct {
	Stores []cmp.DashboardsStore
}

DashboardsStore implements the cmp.DashboardsStore interface, and delegates to all contained DashboardsStores

func (*DashboardsStore) Add

func (multi *DashboardsStore) Add(ctx context.Context, dashboard cmp.Dashboard) (cmp.Dashboard, error)

Add the dashboard to the first responsive Store

func (*DashboardsStore) All

func (multi *DashboardsStore) All(ctx context.Context) ([]cmp.Dashboard, error)

All concatenates the Dashboards of all contained Stores

func (*DashboardsStore) Delete

func (multi *DashboardsStore) Delete(ctx context.Context, dashboard cmp.Dashboard) error

Delete delegates to all Stores, returns success if one Store is successful

func (*DashboardsStore) Get

Get finds the Dashboard by id among all contained Stores

func (*DashboardsStore) Update

func (multi *DashboardsStore) Update(ctx context.Context, dashboard cmp.Dashboard) error

Update the first responsive Store

type KapacitorStore

type KapacitorStore struct {
	Stores []cmp.ServersStore
}

KapacitorStore implements the cmp.ServersStore interface, and delegates to all contained KapacitorStores

func (*KapacitorStore) Add

func (multi *KapacitorStore) Add(ctx context.Context, kap cmp.Server) (cmp.Server, error)

Add the kap to the first responsive Store

func (*KapacitorStore) All

func (multi *KapacitorStore) All(ctx context.Context) ([]cmp.Server, error)

All concatenates the Kapacitors of all contained Stores

func (*KapacitorStore) Delete

func (multi *KapacitorStore) Delete(ctx context.Context, kap cmp.Server) error

Delete delegates to all Stores, returns success if one Store is successful

func (*KapacitorStore) Get

func (multi *KapacitorStore) Get(ctx context.Context, id int) (cmp.Server, error)

Get finds the Source by id among all contained Stores

func (*KapacitorStore) Update

func (multi *KapacitorStore) Update(ctx context.Context, kap cmp.Server) error

Update the first responsive Store

type Layouts

type Layouts struct {
	Stores []cmp.LayoutsStore
}

Layouts is a LayoutsStore that contains multiple LayoutsStores The All method will return the set of all Layouts. Each method will be tried against the Stores slice serially.

func (*Layouts) Add

func (s *Layouts) Add(ctx context.Context, layout cmp.Layout) (cmp.Layout, error)

Add creates a new dashboard in the LayoutsStore. Tries each store sequentially until success.

func (*Layouts) All

func (s *Layouts) All(ctx context.Context) ([]cmp.Layout, error)

All returns the set of all layouts

func (*Layouts) Delete

func (s *Layouts) Delete(ctx context.Context, layout cmp.Layout) error

Delete the dashboard from the store. Searches through all stores to find Layout and then deletes from that store.

func (*Layouts) Get

func (s *Layouts) Get(ctx context.Context, ID string) (cmp.Layout, error)

Get retrieves Layout if `ID` exists. Searches through each store sequentially until success.

func (*Layouts) Update

func (s *Layouts) Update(ctx context.Context, layout cmp.Layout) error

Update the dashboard in the store. Searches through each store sequentially until success.

type OrganizationsStore

type OrganizationsStore struct {
	Stores []cmp.OrganizationsStore
}

OrganizationsStore implements the cmp.OrganizationsStore interface, and delegates to all contained OrganizationsStores

func (*OrganizationsStore) Add

Add the org to the first responsive Store

func (*OrganizationsStore) All

func (multi *OrganizationsStore) All(ctx context.Context) ([]cmp.Organization, error)

All concatenates the Organizations of all contained Stores

func (*OrganizationsStore) CreateDefault

func (multi *OrganizationsStore) CreateDefault(ctx context.Context) error

CreateDefault makes a default organization in the first responsive Store

func (*OrganizationsStore) DefaultOrganization

func (multi *OrganizationsStore) DefaultOrganization(ctx context.Context) (*cmp.Organization, error)

DefaultOrganization returns the first successful DefaultOrganization

func (*OrganizationsStore) Delete

func (multi *OrganizationsStore) Delete(ctx context.Context, org *cmp.Organization) error

Delete delegates to all Stores, returns success if one Store is successful

func (*OrganizationsStore) Get

Get finds the Organization by id among all contained Stores

func (*OrganizationsStore) Update

func (multi *OrganizationsStore) Update(ctx context.Context, org *cmp.Organization) error

Update the first responsive Store

type Protoboards

type Protoboards struct {
	Stores []cmp.ProtoboardsStore
}

Protoboards is a ProtoboardsStore that contains multiple ProtoboardsStores The All method will return the set of all Protoboards. Each method will be tried against the Stores slice serially.

func (*Protoboards) Add

func (s *Protoboards) Add(ctx context.Context, protoboard cmp.Protoboard) (cmp.Protoboard, error)

Add creates a new protoboard in the protoboardsStore.

func (*Protoboards) All

func (s *Protoboards) All(ctx context.Context) ([]cmp.Protoboard, error)

All returns the set of all protoboards

func (*Protoboards) Delete

func (s *Protoboards) Delete(ctx context.Context, protoboard cmp.Protoboard) error

Delete the protoboard from the store.

func (*Protoboards) Get

func (s *Protoboards) Get(ctx context.Context, ID string) (cmp.Protoboard, error)

Get retrieves protoboard if `ID` exists. Searches through each store sequentially until success.

func (*Protoboards) Update

func (s *Protoboards) Update(ctx context.Context, protoboard cmp.Protoboard) error

Update the protoboard in the store.

type SourcesStore

type SourcesStore struct {
	Stores []cmp.SourcesStore
}

SourcesStore delegates to the SourcesStores that compose it

func (*SourcesStore) Add

func (multi *SourcesStore) Add(ctx context.Context, src cmp.Source) (cmp.Source, error)

Add the src to the first Store to respond successfully

func (*SourcesStore) All

func (multi *SourcesStore) All(ctx context.Context) ([]cmp.Source, error)

All concatenates the Sources of all contained Stores

func (*SourcesStore) Delete

func (multi *SourcesStore) Delete(ctx context.Context, src cmp.Source) error

Delete delegates to all stores, returns success if one Store is successful

func (*SourcesStore) Get

func (multi *SourcesStore) Get(ctx context.Context, id int) (cmp.Source, error)

Get finds the Source by id among all contained Stores

func (*SourcesStore) Update

func (multi *SourcesStore) Update(ctx context.Context, src cmp.Source) error

Update the first store to return a successful response

Jump to

Keyboard shortcuts

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