Documentation ¶
Index ¶
- Constants
- func NewApps(dir string, ids cmp.ID, logger cmp.Logger) cmp.LayoutsStore
- func NewDashboards(dir string, ids cmp.ID, logger cmp.Logger) cmp.DashboardsStore
- func NewKapacitors(dir string, ids cmp.ID, logger cmp.Logger) cmp.ServersStore
- func NewOrganizations(dir string, logger cmp.Logger) cmp.OrganizationsStore
- func NewProtoboards(dir string, ids cmp.ID, logger cmp.Logger) cmp.ProtoboardsStore
- func NewSources(dir string, ids cmp.ID, logger cmp.Logger) cmp.SourcesStore
- type Apps
- func (a *Apps) Add(ctx context.Context, layout cmp.Layout) (cmp.Layout, error)
- func (a *Apps) All(ctx context.Context) ([]cmp.Layout, error)
- func (a *Apps) Delete(ctx context.Context, layout cmp.Layout) error
- func (a *Apps) Get(ctx context.Context, ID string) (cmp.Layout, error)
- func (a *Apps) Update(ctx context.Context, layout cmp.Layout) error
- type Dashboards
- func (d *Dashboards) Add(ctx context.Context, dashboard cmp.Dashboard) (cmp.Dashboard, error)
- func (d *Dashboards) All(ctx context.Context) ([]cmp.Dashboard, error)
- func (d *Dashboards) Delete(ctx context.Context, dashboard cmp.Dashboard) error
- func (d *Dashboards) Get(ctx context.Context, id cmp.DashboardID) (cmp.Dashboard, error)
- func (d *Dashboards) Update(ctx context.Context, dashboard cmp.Dashboard) error
- type Kapacitors
- func (d *Kapacitors) Add(ctx context.Context, kapacitor cmp.Server) (cmp.Server, error)
- func (d *Kapacitors) All(ctx context.Context) ([]cmp.Server, error)
- func (d *Kapacitors) Delete(ctx context.Context, kapacitor cmp.Server) error
- func (d *Kapacitors) Get(ctx context.Context, id int) (cmp.Server, error)
- func (d *Kapacitors) Update(ctx context.Context, kapacitor cmp.Server) error
- type Organizations
- func (o *Organizations) Add(ctx context.Context, org *cmp.Organization) (*cmp.Organization, error)
- func (o *Organizations) All(ctx context.Context) ([]cmp.Organization, error)
- func (o *Organizations) CreateDefault(ctx context.Context) error
- func (o *Organizations) DefaultOrganization(ctx context.Context) (*cmp.Organization, error)
- func (o *Organizations) Delete(ctx context.Context, org *cmp.Organization) error
- func (o *Organizations) Get(ctx context.Context, query cmp.OrganizationQuery) (*cmp.Organization, error)
- func (o *Organizations) Update(ctx context.Context, org *cmp.Organization) error
- type Protoboards
- type Sources
- func (d *Sources) Add(ctx context.Context, source cmp.Source) (cmp.Source, error)
- func (d *Sources) All(ctx context.Context) ([]cmp.Source, error)
- func (d *Sources) Delete(ctx context.Context, source cmp.Source) error
- func (d *Sources) Get(ctx context.Context, id int) (cmp.Source, error)
- func (d *Sources) Update(ctx context.Context, source cmp.Source) error
Constants ¶
const AppExt = ".json"
AppExt is the the file extension searched for in the directory for layout files
const DashExt = ".dashboard"
DashExt is the the file extension searched for in the directory for dashboard files
const KapExt = ".kap"
KapExt is the the file extension searched for in the directory for kapacitor files
const OrgExt = ".org"
OrgExt is the the file extension searched for in the directory for org files
const ProtoboardExt = ".json"
ProtoboardExt is the the file extension searched for in the directory for protoboard files
const SrcExt = ".src"
SrcExt is the the file extension searched for in the directory for source files
Variables ¶
This section is empty.
Functions ¶
func NewDashboards ¶
NewDashboards constructs a dashboard store wrapping a file system directory
func NewKapacitors ¶
NewKapacitors constructs a kapacitor store wrapping a file system directory
func NewOrganizations ¶
func NewOrganizations(dir string, logger cmp.Logger) cmp.OrganizationsStore
NewOrganizations constructs a org store wrapping a file system directory
func NewProtoboards ¶
NewProtoboards constructs a protoboard store wrapping a file system directory
func NewSources ¶
NewSources constructs a source store wrapping a file system directory
Types ¶
type Apps ¶
type Apps struct { Dir string // Dir is the directory contained the pre-canned applications. Load func(string) (cmp.Layout, error) // Load loads string name and return a Layout Filename func(string, cmp.Layout) string // Filename takes dir and layout and returns loadable file Create func(string, cmp.Layout) error // Create will write layout to file. ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Remove func(name string) error // Remove file IDs cmp.ID // IDs generate unique ids for new application layouts Logger cmp.Logger }
Apps are canned JSON layouts. Implements LayoutsStore.
type Dashboards ¶
type Dashboards struct { Dir string // Dir is the directory containing the dashboards. Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface Create func(string, interface{}) error // Create will write dashboard to file. ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Remove func(name string) error // Remove file IDs cmp.ID // IDs generate unique ids for new dashboards Logger cmp.Logger }
Dashboards are JSON dashboards stored in the filesystem
func (*Dashboards) Get ¶
func (d *Dashboards) Get(ctx context.Context, id cmp.DashboardID) (cmp.Dashboard, error)
Get returns a dashboard file from the dashboard directory
type Kapacitors ¶
type Kapacitors struct { Dir string // Dir is the directory containing the kapacitors. Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface Create func(string, interface{}) error // Create will write kapacitor to file. ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Remove func(name string) error // Remove file IDs cmp.ID // IDs generate unique ids for new kapacitors Logger cmp.Logger }
Kapacitors are JSON kapacitors stored in the filesystem
type Organizations ¶
type Organizations struct { Dir string // Dir is the directory containing the orgs. Load func(string, interface{}) error // Load loads string name and org passed in as interface ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Logger cmp.Logger }
Organizations are JSON orgs stored in the filesystem
func (*Organizations) Add ¶
func (o *Organizations) Add(ctx context.Context, org *cmp.Organization) (*cmp.Organization, error)
Add is not allowed for the filesystem organization store
func (*Organizations) All ¶
func (o *Organizations) All(ctx context.Context) ([]cmp.Organization, error)
All returns all orgs from the directory
func (*Organizations) CreateDefault ¶
func (o *Organizations) CreateDefault(ctx context.Context) error
CreateDefault is not allowed for the filesystem organization store
func (*Organizations) DefaultOrganization ¶
func (o *Organizations) DefaultOrganization(ctx context.Context) (*cmp.Organization, error)
DefaultOrganization is not allowed for the filesystem organization store
func (*Organizations) Delete ¶
func (o *Organizations) Delete(ctx context.Context, org *cmp.Organization) error
Delete is not allowed for the filesystem organization store
func (*Organizations) Get ¶
func (o *Organizations) Get(ctx context.Context, query cmp.OrganizationQuery) (*cmp.Organization, error)
Get returns a org file from the org directory
func (*Organizations) Update ¶
func (o *Organizations) Update(ctx context.Context, org *cmp.Organization) error
Update is not allowed for the filesystem organization store
type Protoboards ¶
type Protoboards struct { Dir string // Dir is the directory containing protoboard json definitions Load func(string) (cmp.Protoboard, error) // Load receives filename, returns a Protoboard from json file ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. IDs cmp.ID // ID generates unique ids for new protoboards Logger cmp.Logger }
Protoboards are instantiable JSON representation of dashbards. Implements ProtoboardsStore.
func (*Protoboards) All ¶
func (a *Protoboards) All(ctx context.Context) ([]cmp.Protoboard, error)
All returns all protoboards from the directory
func (*Protoboards) Get ¶
func (a *Protoboards) Get(ctx context.Context, ID string) (cmp.Protoboard, error)
Get returns a protoboard file from the protoboard directory
type Sources ¶
type Sources struct { Dir string // Dir is the directory containing the sources. Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface Create func(string, interface{}) error // Create will write source to file. ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename. Remove func(name string) error // Remove file IDs cmp.ID // IDs generate unique ids for new sources Logger cmp.Logger }
Sources are JSON sources stored in the filesystem