Documentation
ΒΆ
Index ΒΆ
- Constants
- Variables
- func Allowed(req Permission, auth *Authorization) bool
- func BucketResource(id ID) resource
- func IsActive(auth *Authorization) bool
- func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error)
- func TaskResource(orgID ID) resource
- type AddDashboardCellOptions
- type Authorization
- type AuthorizationFilter
- type AuthorizationService
- type Axis
- type Bucket
- type BucketFilter
- type BucketService
- type BucketUpdate
- type Cell
- type CellUpdate
- type DBRPMapping
- type DBRPMappingFilter
- type DBRPMappingService
- type Dashboard
- type DashboardFilter
- type DashboardQuery
- type DashboardService
- type DashboardUpdate
- type DecimalPlaces
- type DurationRange
- type EmptyViewProperties
- type Error
- type Field
- type FindOptions
- type GroupBy
- type ID
- type IDGenerator
- type Legend
- type Log
- type LogFilter
- type Organization
- type OrganizationFilter
- type OrganizationService
- type OrganizationUpdate
- type Permission
- type QueryConfig
- type Range
- type RenamableField
- type Run
- type RunFilter
- type Source
- type SourceFields
- type SourceQuery
- type SourceService
- type SourceType
- type SourceUpdate
- type Status
- type TableOptions
- type Task
- type TaskFilter
- type TaskService
- type TaskUpdate
- type TimeShift
- type Timespan
- type TokenGenerator
- type Usage
- type UsageFilter
- type UsageMetric
- type UsageService
- type User
- type UserFilter
- type UserResourceMapping
- type UserResourceMappingFilter
- type UserResourceMappingService
- type UserService
- type UserType
- type UserUpdate
- type V1SourceFields
- type V1ViewProperties
- type View
- type ViewColor
- type ViewContents
- type ViewContentsUpdate
- type ViewFilter
- type ViewProperties
- type ViewService
- type ViewUpdate
Constants ΒΆ
const ( // ReadAction is the action for reading. ReadAction action = "read" // WriteAction is the action for writing. WriteAction action = "write" // CreateAction is the action for creating new resources. CreateAction action = "create" // DeleteAction is the action for deleting an existing resource. DeleteAction action = "delete" )
const ( // UserResource represents the user resource actions can apply to. UserResource = resource("user") // OrganizationResource represents the org resource actions can apply to. OrganizationResource = resource("org") )
const ( V2SourceType = "v2" V1SourceType = "v1" SelfSourceType = "self" )
const ErrCellNotFound = Error("cell not found")
ErrCellNotFound is the error for a missing cell.
const ErrDashboardNotFound = Error("dashboard not found")
ErrDashboardNotFound is the error for a missing dashboard.
const (
ErrSourceNotFound = Error("source not found")
)
const ErrViewNotFound = Error("View not found")
ErrViewNotFound is the error for a missing View.
Variables ΒΆ
var ( // CreateUserPermission is a permission for creating users. CreateUserPermission = Permission{ Action: CreateAction, Resource: UserResource, } // DeleteUserPermission is a permission for deleting users. DeleteUserPermission = Permission{ Action: DeleteAction, Resource: UserResource, } )
Functions ΒΆ
func Allowed ΒΆ
func Allowed(req Permission, auth *Authorization) bool
Allowed returns true if the authorization is active and requested permission level exists in the authorization's list of permissions.
func BucketResource ΒΆ
func BucketResource(id ID) resource
BucketResource constructs a bucket resource.
func IsActive ΒΆ
func IsActive(auth *Authorization) bool
IsActive returns true if the authorization active.
func MarshalViewPropertiesJSON ΒΆ
func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error)
func TaskResource ΒΆ
func TaskResource(orgID ID) resource
TaskResource represents the task resource scoped to an organization.
Types ΒΆ
type AddDashboardCellOptions ΒΆ
type AddDashboardCellOptions struct {
// UsingView specifies the view that should be used as a template
// for the new cells view.
UsingView ID
}
AddDashboardCellOptions are options for adding a dashboard.
type Authorization ΒΆ
type Authorization struct {
ID ID `json:"id"`
Token string `json:"token"`
Status Status `json:"status"`
User string `json:"user,omitempty"`
UserID ID `json:"userID,omitempty"`
Permissions []Permission `json:"permissions"`
}
Authorization is a authorization. π
type AuthorizationFilter ΒΆ
AuthorizationFilter represents a set of filter that restrict the returned results.
type AuthorizationService ΒΆ
type AuthorizationService interface {
// Returns a single authorization by ID.
FindAuthorizationByID(ctx context.Context, id ID) (*Authorization, error)
// Returns a single authorization by Token.
FindAuthorizationByToken(ctx context.Context, t string) (*Authorization, error)
// Returns a list of authorizations that match filter and the total count of matching authorizations.
// Additional options provide pagination & sorting.
FindAuthorizations(ctx context.Context, filter AuthorizationFilter, opt ...FindOptions) ([]*Authorization, int, error)
// Creates a new authorization and sets a.Token and a.UserID with the new identifier.
CreateAuthorization(ctx context.Context, a *Authorization) error
// SetAuthorizationStatus updates the status of the authorization. Useful
// for setting an authorization to inactive or active.
SetAuthorizationStatus(ctx context.Context, id ID, status Status) error
// Removes a authorization by token.
DeleteAuthorization(ctx context.Context, id ID) error
}
AuthorizationService represents a service for managing authorization data.
type Axis ΒΆ
type Axis struct {
Bounds []string `json:"bounds"` // bounds are an arbitrary list of client-defined strings that specify the viewport for a View
LegacyBounds [2]int64 `json:"-"` // legacy bounds are for testing a migration from an earlier version of axis
Label string `json:"label"` // label is a description of this Axis
Prefix string `json:"prefix"` // Prefix represents a label prefix for formatting axis values
Suffix string `json:"suffix"` // Suffix represents a label suffix for formatting axis values
Base string `json:"base"` // Base represents the radix for formatting axis values
Scale string `json:"scale"` // Scale is the axis formatting scale. Supported: "log", "linear"
}
Axis represents the visible extents of a visualization
type Bucket ΒΆ
type Bucket struct {
ID ID `json:"id,omitempty"`
OrganizationID ID `json:"organizationID,omitempty"`
Organization string `json:"organization,omitempty"`
Name string `json:"name"`
RetentionPolicyName string `json:"rp,omitempty"` // This to support v1 sources
RetentionPeriod time.Duration `json:"retentionPeriod"`
}
Bucket is a bucket. π
type BucketFilter ΒΆ
BucketFilter represents a set of filter that restrict the returned results.
type BucketService ΒΆ
type BucketService interface {
// FindBucketByID returns a single bucket by ID.
FindBucketByID(ctx context.Context, id ID) (*Bucket, error)
// FindBucket returns the first bucket that matches filter.
FindBucket(ctx context.Context, filter BucketFilter) (*Bucket, error)
// FindBuckets returns a list of buckets that match filter and the total count of matching buckets.
// Additional options provide pagination & sorting.
FindBuckets(ctx context.Context, filter BucketFilter, opt ...FindOptions) ([]*Bucket, int, error)
// CreateBucket creates a new bucket and sets b.ID with the new identifier.
CreateBucket(ctx context.Context, b *Bucket) error
// UpdateBucket updates a single bucket with changeset.
// Returns the new bucket state after update.
UpdateBucket(ctx context.Context, id ID, upd BucketUpdate) (*Bucket, error)
// DeleteBucket removes a bucket by ID.
DeleteBucket(ctx context.Context, id ID) error
}
BucketService represents a service for managing bucket data.
type BucketUpdate ΒΆ
type BucketUpdate struct {
Name *string `json:"name,omitempty"`
RetentionPeriod *time.Duration `json:"retentionPeriod,omitempty"`
}
BucketUpdate represents updates to a bucket. Only fields which are set are updated.
type Cell ΒΆ
type Cell struct {
ID ID `json:"id"`
X int32 `json:"x"`
Y int32 `json:"y"`
W int32 `json:"w"`
H int32 `json:"h"`
ViewID ID `json:"viewID"`
}
Cell holds positional information about a cell on dashboard and a reference to a cell.
type CellUpdate ΒΆ
type CellUpdate struct {
X *int32 `json:"x"`
Y *int32 `json:"y"`
W *int32 `json:"w"`
H *int32 `json:"h"`
ViewID *ID `json:"viewID"`
}
CellUpdate is the patch structure for a cell.
func (CellUpdate) Apply ΒΆ
func (u CellUpdate) Apply(c *Cell) error
Apply applies an update to a Cell.
type DBRPMapping ΒΆ
type DBRPMapping struct {
Cluster string `json:"cluster"`
Database string `json:"database"`
RetentionPolicy string `json:"retention_policy"`
// Default indicates if this mapping is the default for the cluster and database.
Default bool `json:"default"`
OrganizationID ID `json:"organization_id"`
BucketID ID `json:"bucket_id"`
}
DBRPMapping represents a mapping of a cluster, database and retention policy to an organization ID and bucket ID.
func (*DBRPMapping) Equal ΒΆ
func (m *DBRPMapping) Equal(o *DBRPMapping) bool
Equal checks if the two mappings are identical.
func (DBRPMapping) Validate ΒΆ
func (m DBRPMapping) Validate() error
Validate reports any validation errors for the mapping.
type DBRPMappingFilter ΒΆ
type DBRPMappingFilter struct {
Cluster *string
Database *string
RetentionPolicy *string
Default *bool
}
DBRPMappingFilter represents a set of filters that restrict the returned results by cluster, database and retention policy.
func (DBRPMappingFilter) String ΒΆ
func (f DBRPMappingFilter) String() string
type DBRPMappingService ΒΆ
type DBRPMappingService interface {
// FindBy returns the dbrp mapping the for cluster, db and rp.
FindBy(ctx context.Context, cluster, db, rp string) (*DBRPMapping, error)
// Find returns the first dbrp mapping the matches the filter.
Find(ctx context.Context, filter DBRPMappingFilter) (*DBRPMapping, error)
// FindMany returns a list of dbrp mappings that match filter and the total count of matching dbrp mappings.
FindMany(ctx context.Context, filter DBRPMappingFilter, opt ...FindOptions) ([]*DBRPMapping, int, error)
// Create creates a new dbrp mapping, if a different mapping exists an error is returned.
Create(ctx context.Context, dbrpMap *DBRPMapping) error
// Delete removes a dbrp mapping.
// Deleting a mapping that does not exists is not an error.
Delete(ctx context.Context, cluster, db, rp string) error
}
DBRPMappingService provides a mapping of cluster, database and retention policy to an organization ID and bucket ID.
type DashboardFilter ΒΆ
type DashboardFilter struct {
// TODO(desa): change to be a slice of IDs
ID *ID
}
DashboardFilter is a filter for dashboards.
type DashboardQuery ΒΆ
type DashboardQuery struct {
Command string `json:"query"` // Command is the query itself
Label string `json:"label,omitempty"` // Label is the Y-Axis label for the data
Range *Range `json:"range,omitempty"` // Range is the default Y-Axis range for the data
QueryConfig QueryConfig `json:"queryConfig,omitempty"` // QueryConfig represents the query state that is understood by the data explorer
// TODO(desa): this should be platform.ID
Source string `json:"source"` // Source is the optional URI to the data source for this queryConfig
Shifts []TimeShift `json:"-"` // Shifts represents shifts to apply to an influxql query's time range. Clients expect the shift to be in the generated QueryConfig
}
DashboardQuery includes state for the query builder. This is a transition struct while we move to the full InfluxQL AST
type DashboardService ΒΆ
type DashboardService interface {
// FindDashboardByID returns a single dashboard by ID.
FindDashboardByID(ctx context.Context, id ID) (*Dashboard, error)
// FindDashboards returns a list of dashboards that match filter and the total count of matching dashboards.
// Additional options provide pagination & sorting.
FindDashboards(ctx context.Context, filter DashboardFilter) ([]*Dashboard, int, error)
// CreateDashboard creates a new dashboard and sets b.ID with the new identifier.
CreateDashboard(ctx context.Context, b *Dashboard) error
// UpdateDashboard updates a single dashboard with changeset.
// Returns the new dashboard state after update.
UpdateDashboard(ctx context.Context, id ID, upd DashboardUpdate) (*Dashboard, error)
// AddDashboardCell adds a cell to a dashboard.
AddDashboardCell(ctx context.Context, id ID, c *Cell, opts AddDashboardCellOptions) error
// RemoveDashboardCell removes a dashbaord.
RemoveDashboardCell(ctx context.Context, dashboardID, cellID ID) error
// UpdateDashboardCell replaces the dashboard cell with the provided ID.
UpdateDashboardCell(ctx context.Context, dashboardID, cellID ID, upd CellUpdate) (*Cell, error)
// DeleteDashboard removes a dashboard by ID.
DeleteDashboard(ctx context.Context, id ID) error
// ReplaceDashboardCells replaces all cells in a dashboard
ReplaceDashboardCells(ctx context.Context, id ID, c []*Cell) error
}
DashboardService represents a service for managing dashboard data.
type DashboardUpdate ΒΆ
type DashboardUpdate struct {
Name *string `json:"name"`
}
DashboardUpdate is the patch structure for a dashboard.
func (DashboardUpdate) Apply ΒΆ
func (u DashboardUpdate) Apply(d *Dashboard) error
Apply applies an update to a dashboard.
func (DashboardUpdate) Valid ΒΆ
func (u DashboardUpdate) Valid() error
Valid returns an error if the dashboard update is invalid.
type DecimalPlaces ΒΆ
DecimalPlaces indicates whether decimal places should be enforced, and how many digits it should show.
type DurationRange ΒΆ
DurationRange represents the lower and upper durations of the query config
type EmptyViewProperties ΒΆ
type EmptyViewProperties struct{}
EmptyViewProperties is visualization that has no values
func (EmptyViewProperties) ViewProperties ΒΆ
func (v EmptyViewProperties) ViewProperties()
type Error ΒΆ
type Error string
Error is a domain error encountered while processing chronograf requests.
type Field ΒΆ
type Field struct {
Value interface{} `json:"value"`
Type string `json:"type"`
Alias string `json:"alias"`
Args []Field `json:"args,omitempty"`
}
Field represent influxql fields and functions from the UI
type FindOptions ΒΆ
FindOptions represents options passed to all find methods with multiple results.
type ID ΒΆ
type ID []byte
ID is a unique identifier.
func IDFromString ΒΆ
IDFromString creates an ID from a given string
func (*ID) DecodeFromString ΒΆ
DecodeFromString parses s as a hex-encoded string.
func (ID) MarshalJSON ΒΆ
MarshalJSON implements JSON marshaller for IDs.
func (*ID) UnmarshalJSON ΒΆ
UnmarshalJSON implements JSON unmarshaller for IDs.
type IDGenerator ΒΆ
type IDGenerator interface {
// ID creates unique byte slice ID.
ID() ID
}
IDGenerator represents a generator for IDs.
type Legend ΒΆ
type Legend struct {
Type string `json:"type,omitempty"`
Orientation string `json:"orientation,omitempty"`
}
Legend represents the encoding of data into a legend
type LogFilter ΒΆ
type LogFilter struct {
// TODO(lh): Org is temporary here.
// We will be removing it when the token in context contains org information.
Org *ID
Task *ID
Run *ID
}
LogFilter represents a set of filters that restrict the returned results
type Organization ΒΆ
Organization is a organization. π
type OrganizationFilter ΒΆ
OrganizationFilter represents a set of filter that restrict the returned results.
type OrganizationService ΒΆ
type OrganizationService interface {
// Returns a single organization by ID.
FindOrganizationByID(ctx context.Context, id ID) (*Organization, error)
// Returns the first organization that matches filter.
FindOrganization(ctx context.Context, filter OrganizationFilter) (*Organization, error)
// Returns a list of organizations that match filter and the total count of matching organizations.
// Additional options provide pagination & sorting.
FindOrganizations(ctx context.Context, filter OrganizationFilter, opt ...FindOptions) ([]*Organization, int, error)
// Creates a new organization and sets b.ID with the new identifier.
CreateOrganization(ctx context.Context, b *Organization) error
// Updates a single organization with changeset.
// Returns the new organization state after update.
UpdateOrganization(ctx context.Context, id ID, upd OrganizationUpdate) (*Organization, error)
// Removes a organization by ID.
DeleteOrganization(ctx context.Context, id ID) error
}
OrganizationService represents a service for managing organization data.
type OrganizationUpdate ΒΆ
type OrganizationUpdate struct {
Name *string
}
OrganizationUpdate represents updates to a organization. Only fields which are set are updated.
type Permission ΒΆ
type Permission struct {
Action action `json:"action"`
Resource resource `json:"resource"`
}
Permission defines an action and a resource.
func ReadBucketPermission ΒΆ
func ReadBucketPermission(id ID) Permission
ReadBucketPermission constructs a permission for reading a bucket.
func WriteBucketPermission ΒΆ
func WriteBucketPermission(id ID) Permission
WriteBucketPermission constructs a permission for writing to a bucket.
func (Permission) String ΒΆ
func (p Permission) String() string
type QueryConfig ΒΆ
type QueryConfig struct {
ID string `json:"id,omitempty"`
Database string `json:"database"`
Measurement string `json:"measurement"`
RetentionPolicy string `json:"retentionPolicy"`
Fields []Field `json:"fields"`
Tags map[string][]string `json:"tags"`
GroupBy GroupBy `json:"groupBy"`
AreTagsAccepted bool `json:"areTagsAccepted"`
Fill string `json:"fill,omitempty"`
RawText *string `json:"rawText"`
Range *DurationRange `json:"range"`
Shifts []TimeShift `json:"shifts"`
}
QueryConfig represents UI query from the data explorer
type Range ΒΆ
type Range struct {
Upper int64 `json:"upper"` // Upper is the upper bound
Lower int64 `json:"lower"` // Lower is the lower bound
}
Range represents an upper and lower bound for data
type RenamableField ΒΆ
type RenamableField struct {
InternalName string `json:"internalName"`
DisplayName string `json:"displayName"`
Visible bool `json:"visible"`
}
RenamableField is a column/row field in a DashboardView of type Table
type Run ΒΆ
type Run struct {
ID ID `json:"id,omitempty"`
TaskID ID `json:"taskId"`
Status string `json:"status"`
ScheduledFor string `json:"scheduledFor"`
StartedAt string `json:"startedAt,omitempty"`
FinishedAt string `json:"finishedAt,omitempty"`
RequestedAt string `json:"requestedAt,omitempty"`
Log Log `json:"log"`
}
Run is a record created when a run of a task is scheduled.
type RunFilter ΒΆ
type RunFilter struct {
// TODO(lh): Org is temporary here.
// We will be removing it when the token in context contains org information.
Org *ID
Task *ID
After *ID
Limit int
AfterTime string
BeforeTime string
}
RunFilter represents a set of filters that restrict the returned results
type Source ΒΆ
type Source struct {
ID ID `json:"id,string"` // ID is the unique ID of the source
OrganizationID ID `json:"organizationID"` // OrganizationID is the organization ID that resource belongs to
Default bool `json:"default"` // Default specifies the default source for the application
Name string `json:"name"` // Name is the user-defined name for the source
Type SourceType `json:"type,omitempty"` // Type specifies which kinds of source (enterprise vs oss vs 2.0)
URL string `json:"url"` // URL are the connections to the source
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the source is accepted
Telegraf string `json:"telegraf"` // Telegraf is the db telegraf is written to. By default it is "telegraf"
SourceFields
V1SourceFields
}
Source is an external Influx with time series data. TODO(desa): do we still need default? TODO(desa): do sources belong
type SourceFields ΒΆ
type SourceFields struct {
Token string `json:"token"` // Token is the 2.0 authorization token associated with a source
}
SourceFields
type SourceQuery ΒΆ
SourceQuery is a query for a source.
type SourceService ΒΆ
type SourceService interface {
// DefaultSource retrieves the default source.
DefaultSource(ctx context.Context) (*Source, error)
// FindSourceByID retrieves a source by its ID.
FindSourceByID(ctx context.Context, id ID) (*Source, error)
// FindSources returns a list of all sources.
FindSources(ctx context.Context, opts FindOptions) ([]*Source, int, error)
// CreateSource sets the sources ID and stores it.
CreateSource(ctx context.Context, s *Source) error
// UpdateSource updates the source.
UpdateSource(ctx context.Context, id ID, upd SourceUpdate) (*Source, error)
// DeleteSource removes the source.
DeleteSource(ctx context.Context, id ID) error
}
SourceService is a service for managing sources.
type SourceUpdate ΒΆ
type SourceUpdate struct {
Name *string `json:"name"`
Type *SourceType `json:"type,omitempty"`
Token *string `json:"token"`
URL *string `json:"url"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
Telegraf *string `json:"telegraf"`
Username *string `json:"username,omitempty"`
Password *string `json:"password,omitempty"`
MetaURL *string `json:"metaURL,omitempty"`
FluxURL *string `json:"fluxURL,omitempty"`
Role *string `json:"role,omitempty"`
DefaultRP *string `json:"defaultRP"`
}
SourceUpdate represents updates to a source.
func (SourceUpdate) Apply ΒΆ
func (u SourceUpdate) Apply(s *Source) error
Apply applies an update to a source.
type TableOptions ΒΆ
type TableOptions struct {
VerticalTimeAxis bool `json:"verticalTimeAxis"`
SortBy RenamableField `json:"sortBy"`
Wrapping string `json:"wrapping"`
FixFirstColumn bool `json:"fixFirstColumn"`
}
TableOptions is a type of options for a DashboardView with type Table
type Task ΒΆ
type Task struct {
ID ID `json:"id,omitempty"`
Organization ID `json:"organizationId"`
Name string `json:"name"`
Status string `json:"status"`
Owner User `json:"owner"`
Flux string `json:"flux"`
Every string `json:"every,omitempty"`
Cron string `json:"cron,omitempty"`
}
Task is a task. π
type TaskFilter ΒΆ
TaskFilter represents a set of filters that restrict the returned results
type TaskService ΒΆ
type TaskService interface {
// Returns a single task
FindTaskByID(ctx context.Context, id ID) (*Task, error)
// Returns a list of tasks that match a filter (limit 100) and the total count
// of matching tasks.
FindTasks(ctx context.Context, filter TaskFilter) ([]*Task, int, error)
// Creates a new task
CreateTask(ctx context.Context, t *Task) error
// Updates a single task with changeset
UpdateTask(ctx context.Context, id ID, upd TaskUpdate) (*Task, error)
// Removes a task by ID and purges all associated data and scheduled runs
DeleteTask(ctx context.Context, id ID) error
// Returns logs for a run.
FindLogs(ctx context.Context, filter LogFilter) ([]*Log, int, error)
// Returns a list of runs that match a filter and the total count of returned runs.
FindRuns(ctx context.Context, filter RunFilter) ([]*Run, int, error)
// Returns a single run
FindRunByID(ctx context.Context, id ID) (*Run, error)
// Creates and returns a new run (which is a retry of another run)
RetryRun(ctx context.Context, id ID) (*Run, error)
}
TaskService represents a service for managing one-off and recurring tasks.
type TaskUpdate ΒΆ
type TaskUpdate struct {
Flux *string `json:"flux,omitempty"`
Status *string `json:"status,omitempty"`
}
TaskUpdate represents updates to a task
type TimeShift ΒΆ
type TimeShift struct {
Label string `json:"label"` // Label user facing description
Unit string `json:"unit"` // Unit influxql time unit representation i.e. ms, s, m, h, d
Quantity string `json:"quantity"` // Quantity number of units
}
TimeShift represents a shift to apply to an influxql query's time range
type TokenGenerator ΒΆ
TokenGenerator represents a generator for API tokens.
type Usage ΒΆ
type Usage struct {
OrganizationID *ID `json:"organizationID,omitempty"`
BucketID *ID `json:"bucketID,omitempty"`
Type UsageMetric `json:"type"`
Value float64 `json:"value"`
}
Usage is a metric associated with the utilization of a particular resource.
type UsageFilter ΒΆ
UsageFilter is used to filter usage.
type UsageMetric ΒΆ
type UsageMetric string
UsageMetric used to track classes of usage.
const ( // UsageWriteRequestCount is the name of the metrics for tracking write request count. UsageWriteRequestCount UsageMetric = "usage_write_request_count" // UsageWriteRequestBytes is the name of the metrics for tracking the number of bytes. UsageWriteRequestBytes UsageMetric = "usage_write_request_bytes" )
type UsageService ΒΆ
type UsageService interface {
GetUsage(ctx context.Context, filter UsageFilter) (map[UsageMetric]*Usage, error)
}
UsageService is a service for accessing usage statistics.
type UserFilter ΒΆ
UserFilter represents a set of filter that restrict the returned results.
type UserResourceMapping ΒΆ
type UserResourceMapping struct {
ResourceID ID `json:"resource_id"`
UserID ID `json:"user_id"`
UserType UserType `json:"user_type"`
}
UserResourceMapping represents a mapping of a resource to its user
func (UserResourceMapping) Validate ΒΆ
func (m UserResourceMapping) Validate() error
Validate reports any validation errors for the mapping.
type UserResourceMappingFilter ΒΆ
UserResourceMapping represents a set of filters that restrict the returned results.
type UserResourceMappingService ΒΆ
type UserResourceMappingService interface {
CreateUserResourceMapping(ctx context.Context, m *UserResourceMapping) error
DeleteUserResourceMapping(ctx context.Context, resourceID ID, userID ID) error
}
UserResourceMappingService maps the relationships between users and resources
type UserService ΒΆ
type UserService interface {
// Returns a single user by ID.
FindUserByID(ctx context.Context, id ID) (*User, error)
// Returns the first user that matches filter.
FindUser(ctx context.Context, filter UserFilter) (*User, error)
// Returns a list of users that match filter and the total count of matching users.
// Additional options provide pagination & sorting.
FindUsers(ctx context.Context, filter UserFilter, opt ...FindOptions) ([]*User, int, error)
// Creates a new user and sets u.ID with the new identifier.
CreateUser(ctx context.Context, u *User) error
// Updates a single user with changeset.
// Returns the new user state after update.
UpdateUser(ctx context.Context, id ID, upd UserUpdate) (*User, error)
// Removes a user by ID.
DeleteUser(ctx context.Context, id ID) error
}
UserService represents a service for managing user data.
type UserUpdate ΒΆ
type UserUpdate struct {
Name *string `json:"name"`
}
UserUpdate represents updates to a user. Only fields which are set are updated.
type V1SourceFields ΒΆ
type V1SourceFields struct {
Username string `json:"username,omitempty"` // Username is the username to connect to the source
Password string `json:"password,omitempty"` // Password is in CLEARTEXT
MetaURL string `json:"metaUrl,omitempty"` // MetaURL is the url for the meta node
DefaultRP string `json:"defaultRP"` // DefaultRP is the default retention policy used in database queries to this source
FluxURL string `json:"fluxURL,omitempty"` // FluxURL is the url for a flux connected to a 1x source
}
V1SourceFields are the fields for connecting to a 1.0 source (oss or enterprise)
type V1ViewProperties ΒΆ
type V1ViewProperties struct {
Queries []DashboardQuery `json:"queries"`
Axes map[string]Axis `json:"axes"`
Type string `json:"type"`
ViewColors []ViewColor `json:"colors"`
Legend Legend `json:"legend"`
TableOptions TableOptions `json:"tableOptions,omitempty"`
FieldOptions []RenamableField `json:"fieldOptions"`
TimeFormat string `json:"timeFormat"`
DecimalPlaces DecimalPlaces `json:"decimalPlaces"`
}
func (V1ViewProperties) ViewProperties ΒΆ
func (V1ViewProperties) ViewProperties()
type View ΒΆ
type View struct {
ViewContents
Properties ViewProperties
}
View holds positional and visual information for a View.
func (View) MarshalJSON ΒΆ
func (*View) UnmarshalJSON ΒΆ
type ViewColor ΒΆ
type ViewColor struct {
ID string `json:"id"` // ID is the unique id of the View color
Type string `json:"type"` // Type is how the color is used. Accepted (min,max,threshold)
Hex string `json:"hex"` // Hex is the hex number of the color
Name string `json:"name"` // Name is the user-facing name of the hex color
Value string `json:"value"` // Value is the data value mapped to this color
}
ViewColor represents the encoding of data into visualizations
type ViewContents ΒΆ
type ViewContentsUpdate ΒΆ
type ViewContentsUpdate struct {
Name *string `json:"name"`
}
ViewContentsUpdate is a struct for updating the non properties content of a View.
type ViewFilter ΒΆ
type ViewFilter struct {
ID *ID
}
ViewFilter represents a set of filter that restrict the returned results.
type ViewProperties ΒΆ
type ViewProperties interface {
ViewProperties()
}
func UnmarshalViewPropertiesJSON ΒΆ
func UnmarshalViewPropertiesJSON(b []byte) (ViewProperties, error)
type ViewService ΒΆ
type ViewService interface {
// FindViewByID returns a single View by ID.
FindViewByID(ctx context.Context, id ID) (*View, error)
// FindViews returns a list of Views that match filter and the total count of matching Views.
// Additional options provide pagination & sorting.
FindViews(ctx context.Context, filter ViewFilter) ([]*View, int, error)
// CreateView creates a new View and sets b.ID with the new identifier.
CreateView(ctx context.Context, b *View) error
// UpdateView updates a single View with changeset.
// Returns the new View state after update.
UpdateView(ctx context.Context, id ID, upd ViewUpdate) (*View, error)
// DeleteView removes a View by ID.
DeleteView(ctx context.Context, id ID) error
}
ViewService represents a service for managing View data.
type ViewUpdate ΒΆ
type ViewUpdate struct {
ViewContentsUpdate
Properties ViewProperties
}
ViewUpdate is a struct for updating Views.
func (ViewUpdate) MarshalJSON ΒΆ
func (u ViewUpdate) MarshalJSON() ([]byte, error)
func (*ViewUpdate) UnmarshalJSON ΒΆ
func (u *ViewUpdate) UnmarshalJSON(b []byte) error
func (ViewUpdate) Valid ΒΆ
func (u ViewUpdate) Valid() error
Valid validates the update struct. It expects minimal values to be set.
Source Files
ΒΆ
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
bolt/internal
Package internal is a generated protocol buffer package.
|
Package internal is a generated protocol buffer package. |
|
cmd/chronoctl
command
|
|
|
cmd/chronograf
command
|
|
|
oauth2
Package oauth2 provides http.Handlers necessary for implementing Oauth2 authentication with multiple Providers.
|
Package oauth2 provides http.Handlers necessary for implementing Oauth2 authentication with multiple Providers. |
|
cmd
|
|
|
fluxd
command
|
|
|
influx
command
|
|
|
influxd
command
|
|
|
kit
|
|
|
cli
Package cli creates simple CLI options with ENV overrides using viper.
|
Package cli creates simple CLI options with ENV overrides using viper. |
|
prom
Package prom provides a wrapper around a prometheus metrics registry so that all services are unified in how they expose prometheus metrics.
|
Package prom provides a wrapper around a prometheus metrics registry so that all services are unified in how they expose prometheus metrics. |
|
prom/promtest
Package promtest provides helpers for parsing and extracting prometheus metrics.
|
Package promtest provides helpers for parsing and extracting prometheus metrics. |
|
Package query contains the InfluxDB 2.0 query engine.
|
Package query contains the InfluxDB 2.0 query engine. |
|
ast
Package ast declares the types used to represent the syntax tree for Flux source code.
|
Package ast declares the types used to represent the syntax tree for Flux source code. |
|
ast/asttest
Package asttest implements utilities for testing the abstract syntax tree.
|
Package asttest implements utilities for testing the abstract syntax tree. |
|
ast/asttest/cmpgen
command
cmpgen generates comparison options for the asttest package.
|
cmpgen generates comparison options for the asttest package. |
|
builtin
Package builtin ensures all packages related to Flux built-ins are imported and initialized.
|
Package builtin ensures all packages related to Flux built-ins are imported and initialized. |
|
compiler
The compiler package provides a compiler and Go runtime for a subset of the Flux language.
|
The compiler package provides a compiler and Go runtime for a subset of the Flux language. |
|
complete
Package complete provides types to aid with auto-completion of Flux scripts in editors.
|
Package complete provides types to aid with auto-completion of Flux scripts in editors. |
|
control
Package control controls which resources a query may consume.
|
Package control controls which resources a query may consume. |
|
csv
Package csv contains the csv result encoders and decoders.
|
Package csv contains the csv result encoders and decoders. |
|
execute
Package execute contains the implementation of the execution phase in the query engine.
|
Package execute contains the implementation of the execution phase in the query engine. |
|
execute/executetest
Package executetest contains utilities for testing the query execution phase.
|
Package executetest contains utilities for testing the query execution phase. |
|
functions
Package functions is a collection of built-in functions that are callable in the flux query processor.
|
Package functions is a collection of built-in functions that are callable in the flux query processor. |
|
functions/compspecs
command
|
|
|
functions/prepcsvtests
command
|
|
|
functions/storage
Package storage implements reading from a storage engine into a table as a data source.
|
Package storage implements reading from a storage engine into a table as a data source. |
|
influxql
Package influxql implements the transpiler for executing influxql queries in the 2.0 query engine.
|
Package influxql implements the transpiler for executing influxql queries in the 2.0 query engine. |
|
influxql/spectests
Package spectests the influxql transpiler specification tests.
|
Package spectests the influxql transpiler specification tests. |
|
interpreter
Package interpreter provides the implementation of the Flux interpreter.
|
Package interpreter provides the implementation of the Flux interpreter. |
|
mock
Package mock contains mock implementations of the query package interfaces for testing.
|
Package mock contains mock implementations of the query package interfaces for testing. |
|
options
Package options implements flux options.
|
Package options implements flux options. |
|
parser
Package parser provides a PEG parser for parsing Flux.
|
Package parser provides a PEG parser for parsing Flux. |
|
plan
Package plan implements the flux query planner to plan execution of a query spec.
|
Package plan implements the flux query planner to plan execution of a query spec. |
|
plan/plantest
Package plantest contains utilities for testing the query planning phase.
|
Package plantest contains utilities for testing the query planning phase. |
|
querytest
Package querytest contains utilities for testing the query end-to-end.
|
Package querytest contains utilities for testing the query end-to-end. |
|
repl
Package repl implements the read-eval-print-loop for the command line flux query console.
|
Package repl implements the read-eval-print-loop for the command line flux query console. |
|
semantic
The semantic package provides a graph structure that represents the meaning of a Flux script.
|
The semantic package provides a graph structure that represents the meaning of a Flux script. |
|
semantic/semantictest
Package semantictest contains utilities for testing the semantic package.
|
Package semantictest contains utilities for testing the semantic package. |
|
values
Package values declares the flux data types and implements them.
|
Package values declares the flux data types and implements them. |
|
adaptertest
Package adaptertest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of platform.TaskService.
|
Package adaptertest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of platform.TaskService. |
|
backend
Package backend is a generated protocol buffer package.
|
Package backend is a generated protocol buffer package. |
|
backend/bolt
Package bolt provides an bolt-backed store implementation.
|
Package bolt provides an bolt-backed store implementation. |
|
backend/executor
Package executor contains implementations of backend.Executor that depend on the query service.
|
Package executor contains implementations of backend.Executor that depend on the query service. |
|
mock
Package mock contains mock implementations of different task interfaces.
|
Package mock contains mock implementations of different task interfaces. |
|
options
Package options provides ways to extract the task-related options from a Flux script.
|
Package options provides ways to extract the task-related options from a Flux script. |