platform

package module
v0.0.0-...-d500d3c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 17 Imported by: 2

README ¶

This repository is archived.

The platform repository contains the initial history of InfluxDB 2.0.

The master branch of the influxdb project now contains all of the 2.0 work and git history so far.

This repository will remain archived in its current state indefinitely, so that projects dependent on platform will continue to work.

Moving forward, we recommend that you update your dependencies to use influxdb instead. If you were using Go modules to depend on platform, you may also consider running go mod edit -replace=github.com/influxdata/platform=/dev/null so that you don't accidentally reintroduce a dependency on platform as you transition to influxdb.

Documentation ¶

Index ¶

Examples ¶

Constants ¶

View Source
const (
	OpFindAuthorizationByID    = "FindAuthorizationByID"
	OpFindAuthorizationByToken = "FindAuthorizationByToken"
	OpFindAuthorizations       = "FindAuthorizations"
	OpCreateAuthorization      = "CreateAuthorization"
	OpSetAuthorizationStatus   = "SetAuthorizationStatus"
	OpDeleteAuthorization      = "DeleteAuthorization"
)

auth service op

View Source
const (
	// AuthorizationsResource gives permissions to one or more authorizations.
	AuthorizationsResource = Resource("authorizations") // 0
	// BucketsResource gives permissions to one or more buckets.
	BucketsResource = Resource("buckets") // 1
	// DashboardsResource gives permissions to one or more dashboards.
	DashboardsResource = Resource("dashboards") // 2
	// OrgsResource gives permissions to one or more orgs.
	OrgsResource = Resource("orgs") // 3
	// SourcesResource gives permissions to one or more sources.
	SourcesResource = Resource("sources") // 4
	// TasksResource gives permissions to one or more tasks.
	TasksResource = Resource("tasks") // 5
	// TelegrafsResource type gives permissions to a one or more telegrafs.
	TelegrafsResource = Resource("telegrafs") // 6
	// UsersResource gives permissions to one or more users.
	UsersResource = Resource("users") // 7
)
View Source
const (
	OpFindDashboardByID       = "FindDashboardByID"
	OpFindDashboards          = "FindDashboards"
	OpCreateDashboard         = "CreateDashboard"
	OpUpdateDashboard         = "UpdateDashboard"
	OpAddDashboardCell        = "AddDashboardCell"
	OpRemoveDashboardCell     = "RemoveDashboardCell"
	OpUpdateDashboardCell     = "UpdateDashboardCell"
	OpGetDashboardCellView    = "GetDashboardCellView"
	OpUpdateDashboardCellView = "UpdateDashboardCellView"
	OpDeleteDashboard         = "DeleteDashboard"
	OpReplaceDashboardCells   = "ReplaceDashboardCells"
)

ops for dashboard service.

View Source
const (
	EInternal         = "internal error"
	ENotFound         = "not found"
	EConflict         = "conflict" // action cannot be performed
	EInvalid          = "invalid"  // validation failed
	EEmptyValue       = "empty value"
	EUnavailable      = "unavailable"
	EForbidden        = "forbidden"
	EMethodNotAllowed = "method not allowed"
)

Some error code constant, ideally we want define common platform codes here projects on use platform's error, should have their own central place like this.

View Source
const (
	OpFindLabels  = "FindLabels"
	OpCreateLabel = "CreateLabel"
	OpUpdateLabel = "UpdateLabel"
	OpDeleteLabel = "DeleteLabel"
)
View Source
const (
	OpFindMacroByID = "FindMacroByID"
	OpFindMacros    = "FindMacros"
	OpCreateMacro   = "CreateMacro"
	OpUpdateMacro   = "UpdateMacro"
	OpReplaceMacro  = "ReplaceMacro"
	OpDeleteMacro   = "DeleteMacro"
)

ops for macro error.

View Source
const (
	OrgIDLength       = 8
	BucketIDLength    = 8
	MeasurementLength = OrgIDLength + BucketIDLength
)

Length of components of measurement names.

View Source
const (
	OpFindOrganizationByID = "FindOrganizationByID"
	OpFindOrganization     = "FindOrganization"
	OpFindOrganizations    = "FindOrganizations"
	OpCreateOrganization   = "CreateOrganization"
	OpUpdateOrganization   = "UpdateOrganization"
	OpDeleteOrganization   = "DeleteOrganization"
)

ops for orgs error and orgs op logs.

View Source
const (
	DefaultPageSize = 20
	MaxPageSize     = 100
)
View Source
const (
	OpListTargets   = "ListTargets"
	OpAddTarget     = "AddTarget"
	OpGetTargetByID = "GetTargetByID"
	OpRemoveTarget  = "RemoveTarget"
	OpUpdateTarget  = "UpdateTarget"
)

ops for ScraperTarget Store

View Source
const (
	// V2SourceType is an InfluxDBv2 type.
	V2SourceType = "v2"
	// V1SourceType is an InfluxDBv1 type.
	V1SourceType = "v1"
	// SelfSourceType is the source hosting the UI.
	SelfSourceType = "self"
)
View Source
const (
	OpDefaultSource  = "DefaultSource"
	OpFindSourceByID = "FindSourceByID"
	OpFindSources    = "FindSources"
	OpCreateSource   = "CreateSource"
	OpUpdateSource   = "UpdateSource"
	OpDeleteSource   = "DeleteSource"
)

ops for sources.

View Source
const (
	TaskDefaultPageSize = 100
	TaskMaxPageSize     = 500
)
View Source
const (
	ErrTelegrafPluginNameUnmatch   = "the telegraf plugin is name %s doesn't match the config %s"
	ErrNoTelegrafPlugins           = "there is no telegraf plugin in the config"
	ErrUnsupportTelegrafPluginType = "unsupported telegraf plugin type %s"
	ErrUnsupportTelegrafPluginName = "unsupported telegraf plugin %s, type %s"
)

errors

View Source
const (
	OpFindUserByID = "FindUserByID"
	OpFindUser     = "FindUser"
	OpFindUsers    = "FindUsers"
	OpCreateUser   = "CreateUser"
	OpUpdateUser   = "UpdateUser"
	OpDeleteUser   = "DeleteUser"
)

Ops for user errors and op log.

View Source
const (
	OpFindViewByID = "FindViewByID"
	OpFindViews    = "FindViews"
	OpCreateView   = "CreateView"
	OpUpdateView   = "UpdateView"
	OpDeleteView   = "DeleteView"
)

ops for view.

View Source
const (
	// BucketTypeLogs defines the bucket ID of the system logs.
	BucketTypeLogs = BucketType(iota + 10)
)
View Source
const ErrCellNotFound = "cell not found"

ErrCellNotFound is the error msg for a missing cell.

View Source
const ErrDashboardNotFound = "dashboard not found"

ErrDashboardNotFound is the error msg for a missing dashboard.

View Source
const ErrLabelNotFound = ChronografError("label not found")

ErrLabelNotFound is the error for a missing Label.

View Source
const ErrScraperTargetNotFound = "scraper target not found"

ErrScraperTargetNotFound is the error msg for a missing scraper target.

View Source
const ErrSessionExpired = "session has expired"

ErrSessionExpired is the error message for expired sessions.

View Source
const ErrSessionNotFound = "session not found"

ErrSessionNotFound is the error messages for a missing sessions.

View Source
const (
	// ErrSourceNotFound is an error message when a source does not exist.
	ErrSourceNotFound = "source not found"
)
View Source
const ErrTelegrafConfigInvalidOrganizationID = "invalid organization ID"

ErrTelegrafConfigInvalidOrganizationID is the error message for a missing or invalid organization ID.

View Source
const ErrViewNotFound = "view not found"

ErrViewNotFound is the error msg for a missing View.

View Source
const IDLength = 16

IDLength is the exact length a string (or a byte slice representing it) must have in order to be decoded into a valid ID.

View Source
const InfiniteRetention = 0

InfiniteRetention is default infinite retention period.

View Source
const (
	// PrometheusScraperType parses metrics from a prometheus endpoint.
	PrometheusScraperType = "prometheus"
)

Scraper types

Variables ¶

View Source
var (
	// ErrAuthorizerNotSupported notes that the provided authorizer is not supported for the action you are trying to perform.
	ErrAuthorizerNotSupported = errors.New("your authorizer is not supported, please use *platform.Authorization as authorizer")
	// ErrInvalidResource notes that the provided resource is invalid
	ErrInvalidResource = errors.New("unknown resource for permission")
	// ErrInvalidAction notes that the provided action is invalid
	ErrInvalidAction = errors.New("unknown action for permission")
)
View Source
var (
	OpFindBucketByID = "FindBucketByID"
	OpFindBucket     = "FindBucket"
	OpFindBuckets    = "FindBuckets"
	OpCreateBucket   = "CreateBucket"
	OpUpdateBucket   = "UpdateBucket"
	OpDeleteBucket   = "DeleteBucket"
)

ops for buckets error and buckets op logs.

View Source
var (
	// OpFindSession represents the operation that looks for sessions.
	OpFindSession = "FindSession"
	// OpExpireSession represents the operation that expires sessions.
	OpExpireSession = "ExpireSession"
	// OpCreateSession represents the operation that creates a session for a given user.
	OpCreateSession = "CreateSession"
)
View Source
var (
	OpFindTelegrafConfigByID = "FindTelegrafConfigByID"
	OpFindTelegrafConfig     = "FindTelegrafConfig"
	OpFindTelegrafConfigs    = "FindTelegrafConfigs"
	OpCreateTelegrafConfig   = "CreateTelegrafConfig"
	OpUpdateTelegrafConfig   = "UpdateTelegrafConfig"
	OpDeleteTelegrafConfig   = "DeleteTelegrafConfig"
)

ops for buckets error and buckets op logs.

View Source
var (
	// ErrInvalidUserType notes that the provided UserType is invalid
	ErrInvalidUserType = errors.New("unknown user type")
	// ErrUserIDRequired notes that the ID was not provided
	ErrUserIDRequired = errors.New("user id is required")
	// ErrResourceIDRequired notes that the provided ID was not provided
	ErrResourceIDRequired = errors.New("resource id is required")
)

AllResources is the list of all known resource types.

View Source
var DefaultDashboardFindOptions = FindOptions{
	SortBy: "ID",
}

DefaultDashboardFindOptions are the default find options for dashboards

View Source
var DefaultOperationLogFindOptions = FindOptions{
	Descending: true,
	Limit:      100,
}

DefaultOperationLogFindOptions are the default options for the operation log.

View Source
var ErrInvalidID = errors.New("invalid ID")

ErrInvalidID signifies invalid IDs.

View Source
var ErrInvalidIDLength = errors.New("id must have a length of 16 bytes")

ErrInvalidIDLength is returned when an ID has the incorrect number of bytes.

View Source
var (
	// ErrUnableToCreateToken sanitized error message for all errors when a user cannot create a token
	ErrUnableToCreateToken = &Error{
		Msg:  "unable to create token",
		Code: EInvalid,
	}
)

OrgResources is the list of all known resource types that belong to an organization.

Functions ¶

func CreateMeasurement ¶

func CreateMeasurement(org, bucket []byte) ([]byte, error)

CreateMeasurement returns 16 bytes that represent a measurement.

If either org or bucket are short then an error is returned, otherwise the first 8 bytes of each are combined and returned.

func ErrorCode ¶

func ErrorCode(err error) string

ErrorCode returns the code of the root error, if available; otherwise returns EINTERNAL.

func ErrorMessage ¶

func ErrorMessage(err error) string

ErrorMessage returns the human-readable message of the error, if available. Otherwise returns a generic error message.

func ErrorOp ¶

func ErrorOp(err error) string

ErrorOp returns the op of the error, if available; otherwise return empty string.

func IsActive ¶

func IsActive(a *Authorization) bool

IsActive is a stub for idpe.

func MarshalViewPropertiesJSON ¶

func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error)

MarshalViewPropertiesJSON encodes a view into JSON bytes.

func PermissionAllowed ¶

func PermissionAllowed(p Permission, ps []Permission) bool

PermissionAllowed

func ReadMeasurement ¶

func ReadMeasurement(name []byte) (orgID, bucketID []byte, err error)

ReadMeasurement reads the provided measurement name and returns an Org ID and bucket ID. It returns an error if the provided name has an invalid length.

ReadMeasurement does not allocate, and instead returns sub-slices of name, so callers should be careful about subsequent mutations to the provided name slice.

func SortDashboards ¶

func SortDashboards(by string, ds []*Dashboard)

SortDashboards sorts a slice of dashboards by a field.

func ValidScraperType ¶

func ValidScraperType(s string) bool

ValidScraperType returns true is the type string is valid

func WithErrorCode ¶

func WithErrorCode(code string) func(*Error)

WithErrorCode sets the code on the error.

func WithErrorErr ¶

func WithErrorErr(err error) func(*Error)

WithErrorErr sets the err on the error.

func WithErrorMsg ¶

func WithErrorMsg(msg string) func(*Error)

WithErrorMsg sets the message on the error.

func WithErrorOp ¶

func WithErrorOp(op string) func(*Error)

WithErrorOp sets the message on the error.

Types ¶

type Action ¶

type Action string

Action is an enum defining all possible resource operations

const (
	// ReadAction is the action for reading.
	ReadAction Action = "read" // 1
	// WriteAction is the action for writing.
	WriteAction Action = "write" // 2
)

func (Action) Valid ¶

func (a Action) Valid() (err error)

Valid checks if the action is a member of the Action enum

type AddDashboardCellOptions ¶

type AddDashboardCellOptions struct {
	View *View
}

AddDashboardCellOptions are options for adding a dashboard.

type Authorization ¶

type Authorization struct {
	ID          ID           `json:"id"`
	Token       string       `json:"token"`
	Status      Status       `json:"status"`
	Description string       `json:"description"`
	OrgID       ID           `json:"orgID"`
	UserID      ID           `json:"userID"`
	Permissions []Permission `json:"permissions"`
}

Authorization is an authorization. 🎉

func (*Authorization) Allowed ¶

func (a *Authorization) Allowed(p Permission) bool

Allowed returns true if the authorization is active and request permission exists in the authorization's list of permissions.

func (*Authorization) GetUserID ¶

func (a *Authorization) GetUserID() ID

GetUserID returns the user id.

func (*Authorization) Identifier ¶

func (a *Authorization) Identifier() ID

Identifier returns the authorizations ID and is used for auditing.

func (*Authorization) IsActive ¶

func (a *Authorization) IsActive() bool

IsActive returns true if the authorization active.

func (*Authorization) Kind ¶

func (a *Authorization) Kind() string

Kind returns session and is used for auditing.

type AuthorizationFilter ¶

type AuthorizationFilter struct {
	Token *string
	ID    *ID

	UserID *ID
	User   *string
}

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 Authorizer ¶

type Authorizer interface {
	// Allowed returns true is the associated permission is allowed by the authorizer
	Allowed(p Permission) bool

	// ID returns an identifier used for auditing.
	Identifier() ID

	// GetUserID returns the user id.
	GetUserID() ID

	// Kind metadata for auditing.
	Kind() string
}

Authorizer will authorize a permission.

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 BasicAuthService ¶

type BasicAuthService interface {
	SetPassword(ctx context.Context, name string, password string) error
	ComparePassword(ctx context.Context, name string, password string) error
	CompareAndSetPassword(ctx context.Context, name string, old string, new string) error
}

BasicAuthService is the service for managing basic auth.

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 ¶

type BucketFilter struct {
	ID             *ID
	Name           *string
	OrganizationID *ID
	Organization   *string
}

BucketFilter represents a set of filter that restrict the returned results.

func (BucketFilter) QueryParams ¶

func (f BucketFilter) QueryParams() map[string][]string

QueryParams Converts BucketFilter fields to url query params.

type BucketOperationLogService ¶

type BucketOperationLogService interface {
	// GetBucketOperationLog retrieves the operation log for the bucket with the provided id.
	GetBucketOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}

BucketOperationLogService is an interface for retrieving the operation log for a bucket.

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 BucketType ¶

type BucketType int

BucketType defines known system-buckets.

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 BuilderConfig ¶

type BuilderConfig struct {
	Buckets []string `json:"buckets"`
	Tags    []struct {
		Key    string   `json:"key"`
		Values []string `json:"values"`
	} `json:"tags"`
	Functions []struct {
		Name string `json:"name"`
	} `json:"functions"`
}

type Cell ¶

type Cell struct {
	ID ID    `json:"id,omitempty"`
	X  int32 `json:"x"`
	Y  int32 `json:"y"`
	W  int32 `json:"w"`
	H  int32 `json:"h"`
}

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"`
}

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.

func (CellUpdate) Valid ¶

func (u CellUpdate) Valid() *Error

Valid returns an error if the cell update is invalid.

type ChronografError ¶

type ChronografError string

ChronografError is a domain error encountered while processing chronograf requests.

func (ChronografError) Error ¶

func (e ChronografError) Error() string

ChronografError returns the string of an error.

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 Dashboard ¶

type Dashboard struct {
	ID          ID            `json:"id,omitempty"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Cells       []*Cell       `json:"cells"`
	Meta        DashboardMeta `json:"meta"`
}

Dashboard represents all visual and query data for a dashboard.

type DashboardFilter ¶

type DashboardFilter struct {
	IDs []*ID
}

DashboardFilter is a filter for dashboards.

type DashboardMeta ¶

type DashboardMeta struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

DashboardMeta contains meta information about dashboards

type DashboardOperationLogService ¶

type DashboardOperationLogService interface {
	// GetDashboardOperationLog retrieves the operation log for the dashboard with the provided id.
	GetDashboardOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}

DashboardOperationLogService is an interface for retrieving the operation log for a dashboard.

type DashboardQuery ¶

type DashboardQuery struct {
	Text          string        `json:"text"`
	Type          string        `json:"type"`
	SourceID      string        `json:"sourceID"`
	EditMode      string        `json:"editMode"` // Either "builder" or "advanced"
	Name          string        `json:"name"`     // Term or phrase that refers to the query
	BuilderConfig BuilderConfig `json:"builderConfig"`
}

DashboardQuery represents a query used in a dashboard cell

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, opts FindOptions) ([]*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)

	// GetDashboardCellView retrieves a dashboard cells view.
	GetDashboardCellView(ctx context.Context, dashboardID, cellID ID) (*View, error)

	// UpdateDashboardCellView retrieves a dashboard cells view.
	UpdateDashboardCellView(ctx context.Context, dashboardID, cellID ID, upd ViewUpdate) (*View, 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"`
	Description *string `json:"description"`
}

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 ¶

type DecimalPlaces struct {
	IsEnforced bool  `json:"isEnforced"`
	Digits     int32 `json:"digits"`
}

DecimalPlaces indicates whether decimal places should be enforced, and how many digits it should show.

type EmptyViewProperties ¶

type EmptyViewProperties struct{}

EmptyViewProperties is visualization that has no values

func (EmptyViewProperties) GetType ¶

func (v EmptyViewProperties) GetType() string

type Error ¶

type Error struct {
	Code string
	Msg  string
	Op   string
	Err  error
}

Error is the error struct of platform.

Errors may have error codes, human-readable messages, and a logical stack trace.

The Code targets automated handlers so that recovery can occur. Msg is used by the system operator to help diagnose and fix the problem. Op and Err chain errors together in a logical stack trace to further help operators.

To create a simple error,

&Error{
    Code:ENotFound,
}

To show where the error happens, add Op.

&Error{
    Code: ENotFound,
    Op: "bolt.FindUserByID"
}

To show an error with a unpredictable value, add the value in Msg.

&Error{
   Code: EConflict,
   Message: fmt.Sprintf("organization with name %s already exist", aName),
}

To show an error wrapped with another error.

&Error{
    Code:EInternal,
    Err: err,
}.

func NewError ¶

func NewError(options ...func(*Error)) *Error

NewError returns an instance of an error.

func (*Error) Error ¶

func (e *Error) Error() string

Error implement the error interface by outputing the Code and Err.

func (*Error) MarshalJSON ¶

func (e *Error) MarshalJSON() (result []byte, err error)

MarshalJSON recursively marshals the stack of Err.

func (*Error) UnmarshalJSON ¶

func (e *Error) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON recursively unmarshals the error stack.

type FindOptions ¶

type FindOptions struct {
	Limit      int
	Offset     int
	SortBy     string
	Descending bool
}

FindOptions represents options passed to all find methods with multiple results.

func (FindOptions) QueryParams ¶

func (f FindOptions) QueryParams() map[string][]string

QueryParams returns a map containing url query params.

type GaugeViewProperties ¶

type GaugeViewProperties struct {
	Type              string           `json:"type"`
	Queries           []DashboardQuery `json:"queries"`
	Prefix            string           `json:"prefix"`
	Suffix            string           `json:"suffix"`
	ViewColors        []ViewColor      `json:"colors"`
	DecimalPlaces     DecimalPlaces    `json:"decimalPlaces"`
	Note              string           `json:"note"`
	ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

GaugeViewProperties represents options for gauge view in Chronograf

func (GaugeViewProperties) GetType ¶

func (v GaugeViewProperties) GetType() string

type ID ¶

type ID uint64

ID is a unique identifier.

Its zero value is not a valid ID.

func IDFromString ¶

func IDFromString(str string) (*ID, error)

IDFromString creates an ID from a given string.

It errors if the input string does not match a valid ID.

func InternalBucketID ¶

func InternalBucketID(t BucketType) (*ID, error)

InternalBucketID returns the ID for an organization's specified internal bucket

func InvalidID ¶

func InvalidID() ID

InvalidID returns a zero ID.

func (*ID) Decode ¶

func (i *ID) Decode(b []byte) error

Decode parses b as a hex-encoded byte-slice-string.

It errors if the input byte slice does not have the correct length or if it contains all zeros.

func (*ID) DecodeFromString ¶

func (i *ID) DecodeFromString(s string) error

DecodeFromString parses s as a hex-encoded string.

func (ID) Encode ¶

func (i ID) Encode() ([]byte, error)

Encode converts ID to a hex-encoded byte-slice-string.

It errors if the receiving ID holds its zero value.

func (ID) GoString ¶

func (i ID) GoString() string

GoString formats the ID the same as the String method. Without this, when using the %#v verb, an ID would be printed as a uint64, so you would see e.g. 0x2def021097c6000 instead of 02def021097c6000 (note the leading 0x, which means the former doesn't show up in searches for the latter).

func (ID) MarshalJSON ¶

func (i ID) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON marshaller for IDs.

func (ID) String ¶

func (i ID) String() string

String returns the ID as a hex encoded string.

Returns an empty string in the case the ID is invalid.

func (*ID) UnmarshalJSON ¶

func (i *ID) UnmarshalJSON(b []byte) error

UnmarshalJSON implements JSON unmarshaller for IDs.

func (ID) Valid ¶

func (i ID) Valid() bool

Valid checks whether the receiving ID is a valid one or not.

type IDGenerator ¶

type IDGenerator interface {
	// ID creates unique byte slice ID.
	ID() ID
}

IDGenerator represents a generator for IDs.

type KeyValueLog ¶

type KeyValueLog interface {
	// AddLogEntry adds an entry (v,t) to the log defined for the key k.
	AddLogEntry(ctx context.Context, k []byte, v []byte, t time.Time) error

	// ForEachLogEntry iterates through all the log entries at key k and applies the function fn for each record.
	ForEachLogEntry(ctx context.Context, k []byte, opts FindOptions, fn func(v []byte, t time.Time) error) error

	// FirstLogEntry is used to retrieve the first entry in the log at key k.
	FirstLogEntry(ctx context.Context, k []byte) ([]byte, time.Time, error)

	// LastLogEntry is used to retrieve the last entry in the log at key k.
	LastLogEntry(ctx context.Context, k []byte) ([]byte, time.Time, error)
}

KeyValuleLog is a generic type logs key-value pairs. This interface is intended to be used to construct other higher-level log-like resources such as an oplog or audit log.

The idea is to create a log who values can be accessed at the key k: k -> [(v0,t0) (v1,t1) ... (vn,tn)]

Logs may be retrieved in ascending or descending time order and support limits and offsets.

Example ¶
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/influxdata/platform"
	"github.com/influxdata/platform/bolt"
)

func main() {
	c := bolt.NewClient()
	c.Path = "example.bolt"
	ctx := context.Background()
	if err := c.Open(ctx); err != nil {
		panic(err)
	}

	for i := 0; i < 10; i++ {
		if err := c.AddLogEntry(ctx, []byte("bucket_0_auditlog"), []byte(fmt.Sprintf("abc-%v", i)), time.Now()); err != nil {
			panic(err)
		}
	}

	opts := platform.FindOptions{Limit: 2, Offset: 1, Descending: false}
	if err := c.ForEachLogEntry(ctx, []byte("bucket_0_auditlog"), opts, func(v []byte, t time.Time) error {
		fmt.Println(t.UTC())
		fmt.Println(string(v))
		fmt.Println()
		return nil
	}); err != nil {
		panic(err)
	}

	v, t, err := c.LastLogEntry(ctx, []byte("bucket_0_auditlog"))
	if err != nil {
		panic(err)
	}
	fmt.Println(t.UTC())
	fmt.Println(string(v))
	fmt.Println()

	v, t, err = c.FirstLogEntry(ctx, []byte("bucket_0_auditlog"))
	if err != nil {
		panic(err)
	}
	fmt.Println(t.UTC())
	fmt.Println(string(v))
	fmt.Println()
}
Output:

type Label ¶

type Label struct {
	ResourceID ID                `json:"resourceID"`
	Name       string            `json:"name"`
	Properties map[string]string `json:"properties"`
}

func (*Label) Validate ¶

func (l *Label) Validate() error

Validate returns an error if the label is invalid.

type LabelFilter ¶

type LabelFilter struct {
	ResourceID ID
	Name       string
}

type LabelService ¶

type LabelService interface {
	// FindLabels returns a list of labels that match a filter
	FindLabels(ctx context.Context, filter LabelFilter, opt ...FindOptions) ([]*Label, error)

	// CreateLabel creates a new label
	CreateLabel(ctx context.Context, l *Label) error

	// UpdateLabel updates a label with a changeset.
	UpdateLabel(ctx context.Context, l *Label, upd LabelUpdate) (*Label, error)

	// DeleteLabel deletes a label
	DeleteLabel(ctx context.Context, l Label) error
}

type LabelUpdate ¶

type LabelUpdate struct {
	Properties map[string]string `json:"properties,omitempty"`
}

LabelUpdate represents a changeset for a label. Only fields which are set are updated.

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 LinePlusSingleStatProperties ¶

type LinePlusSingleStatProperties struct {
	Queries           []DashboardQuery `json:"queries"`
	Axes              map[string]Axis  `json:"axes"`
	Type              string           `json:"type"`
	Legend            Legend           `json:"legend"`
	ViewColors        []ViewColor      `json:"colors"`
	Prefix            string           `json:"prefix"`
	Suffix            string           `json:"suffix"`
	DecimalPlaces     DecimalPlaces    `json:"decimalPlaces"`
	Note              string           `json:"note"`
	ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

LinePlusSingleStatProperties represents options for line plus single stat view in Chronograf

func (LinePlusSingleStatProperties) GetType ¶

type Log ¶

type Log string

Log represents a link to a log resource

type LogColumnSetting ¶

type LogColumnSetting struct {
	Type  string `json:"type"`
	Value string `json:"value"`
	Name  string `json:"name,omitempty"`
}

LogColumnSetting represent the settings for a specific column of a Log Viewer.

type LogFilter ¶

type LogFilter struct {
	Org  *ID
	Task *ID
	Run  *ID
}

LogFilter represents a set of filters that restrict the returned results

type LogViewProperties ¶

type LogViewProperties struct {
	Type    string            `json:"type"`
	Columns []LogViewerColumn `json:"columns"`
}

LogViewProperties represents options for log viewer in Chronograf.

func (LogViewProperties) GetType ¶

func (v LogViewProperties) GetType() string

type LogViewerColumn ¶

type LogViewerColumn struct {
	Name     string             `json:"name"`
	Position int32              `json:"position"`
	Settings []LogColumnSetting `json:"settings"`
}

LogViewerColumn represents a specific column in a Log Viewer.

type LookupService ¶

type LookupService interface {
	// Name returns the name for the resource and ID.
	Name(ctx context.Context, resource Resource, id ID) (string, error)
}

LookupService provides field lookup for the resource and ID.

type Macro ¶

type Macro struct {
	ID        ID              `json:"id,omitempty"`
	Name      string          `json:"name"`
	Selected  []string        `json:"selected"`
	Arguments *MacroArguments `json:"arguments"`
}

A Macro describes a keyword that can be expanded into several possible values when used in an InfluxQL or Flux query

func (*Macro) Valid ¶

func (m *Macro) Valid() error

Valid returns an error if a Macro contains invalid data

type MacroArguments ¶

type MacroArguments struct {
	Type   string      `json:"type"`   // "constant", "map", or "query"
	Values interface{} `json:"values"` // either MacroQueryValues, MacroConstantValues, MacroMapValues
}

A MacroArguments contains arguments used when expanding a Macro

func (*MacroArguments) UnmarshalJSON ¶

func (a *MacroArguments) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals json into a MacroArguments struct, using the `Type` field to assign the approriate struct to the `Values` field

type MacroConstantValues ¶

type MacroConstantValues []string

MacroConstantValues are the data for expanding a constants-based Macro

type MacroMapValues ¶

type MacroMapValues map[string]string

MacroMapValues are the data for expanding a map-based Macro

type MacroQueryValues ¶

type MacroQueryValues struct {
	Query    string `json:"query"`
	Language string `json:"language"` // "influxql" or "flux"
}

MacroQueryValues contains a query used when expanding a query-based Macro

type MacroService ¶

type MacroService interface {
	// FindMacro finds a single macro from the store by its ID
	FindMacroByID(ctx context.Context, id ID) (*Macro, error)

	// FindMacros returns all macros in the store
	FindMacros(ctx context.Context) ([]*Macro, error)

	// CreateMacro creates a new macro and assigns it an ID
	CreateMacro(ctx context.Context, m *Macro) error

	// UpdateMacro updates a single macro with a changeset
	UpdateMacro(ctx context.Context, id ID, update *MacroUpdate) (*Macro, error)

	// ReplaceMacro replaces a single macro
	ReplaceMacro(ctx context.Context, macro *Macro) error

	// DeleteMacro removes a macro from the store
	DeleteMacro(ctx context.Context, id ID) error
}

MacroService describes a service for managing Macros

type MacroUpdate ¶

type MacroUpdate struct {
	Name      string          `json:"name"`
	Selected  []string        `json:"selected"`
	Arguments *MacroArguments `json:"arguments"`
}

A MacroUpdate describes a set of changes that can be applied to a Macro

func (*MacroUpdate) Apply ¶

func (u *MacroUpdate) Apply(m *Macro) error

Apply applies non-zero fields from a MacroUpdate to a Macro

func (*MacroUpdate) Valid ¶

func (u *MacroUpdate) Valid() error

Valid returns an error if a Macro changeset is not valid

type MarkdownViewProperties ¶

type MarkdownViewProperties struct {
	Type string `json:"type"`
	Note string `json:"note"`
}

func (MarkdownViewProperties) GetType ¶

func (v MarkdownViewProperties) GetType() string

type OnboardingRequest ¶

type OnboardingRequest struct {
	User            string `json:"username"`
	Password        string `json:"password"`
	Org             string `json:"org"`
	Bucket          string `json:"bucket"`
	RetentionPeriod uint   `json:"retentionPeriodHrs,omitempty"`
}

OnboardingRequest is the request to setup defaults.

type OnboardingResults ¶

type OnboardingResults struct {
	User   *User          `json:"user"`
	Org    *Organization  `json:"org"`
	Bucket *Bucket        `json:"bucket"`
	Auth   *Authorization `json:"auth"`
}

OnboardingResults is a group of elements required for first run.

type OnboardingService ¶

type OnboardingService interface {
	BasicAuthService
	BucketService
	OrganizationService
	UserService
	AuthorizationService

	// IsOnboarding determine if onboarding request is allowed.
	IsOnboarding(ctx context.Context) (bool, error)
	// Generate OnboardingResults.
	Generate(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)
}

OnboardingService represents a service for the first run.

type OperationLogEntry ¶

type OperationLogEntry struct {
	Description string    `json:"description"`
	UserID      ID        `json:"userID,omitempty"`
	Time        time.Time `json:"time,omitempty"`
}

OperationLogEntry is a record in an operation log.

type Organization ¶

type Organization struct {
	ID   ID     `json:"id,omitempty"`
	Name string `json:"name"`
}

Organization is an organization. 🎉

type OrganizationFilter ¶

type OrganizationFilter struct {
	Name *string
	ID   *ID
}

OrganizationFilter represents a set of filter that restrict the returned results.

type OrganizationOperationLogService ¶

type OrganizationOperationLogService interface {
	// GetOrganizationOperationLog retrieves the operation log for the org with the provided id.
	GetOrganizationOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}

OrganizationOperationLogService is an interface for retrieving the operation log for an org.

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 PagingFilter ¶

type PagingFilter interface {
	// QueryParams returns a map containing url query params.
	QueryParams() map[string][]string
}

PagingFilter represents a filter containing url query params.

type PagingLinks struct {
	Prev string `json:"prev,omitempty"`
	Self string `json:"self"`
	Next string `json:"next,omitempty"`
}

PagingLinks represents paging links.

type Permission ¶

type Permission struct {
	Action   Action   `json:"action"`
	Resource Resource `json:"resource"`
	ID       *ID      `json:"id,omitempty"`
}

Permission defines an action and a resource.

func NewPermission ¶

func NewPermission(a Action, r Resource) (*Permission, error)

NewPermission returns a permission with provided arguments.

func NewPermissionAtID ¶

func NewPermissionAtID(id ID, a Action, r Resource) (*Permission, error)

NewPermissionAtID creates a permission with the provided arguments.

func OperPermissions ¶

func OperPermissions() []Permission

OperPermissions are the default permissions for those who setup the application.

func OrgAdminPermissions ¶

func OrgAdminPermissions(orgID ID) []Permission

OrgAdminPermissions are the default permissions for org admins.

func OrgMemberPermissions ¶

func OrgMemberPermissions(orgID ID) []Permission

OrgMemberPermissions are the default permissions for org members.

func (Permission) String ¶

func (p Permission) String() string

func (*Permission) Valid ¶

func (p *Permission) Valid() error

Valid checks if there the resource and action provided is known.

type Proto ¶

type Proto struct {
	ID         ID               `json:"id"`
	Name       string           `json:"name"`
	Dashboards []ProtoDashboard `json:"dashboards,omitempty"`
}

Proto is templated resource.

type ProtoDashboard ¶

type ProtoDashboard struct {
	Dashboard Dashboard   `json:"dashboard"`
	Views     map[ID]View `json:"views"`
}

ProtoDashboard is a templated dashboard.

type ProtoService ¶

type ProtoService interface {
	// TODO(desa): add pagination here eventually.
	FindProtos(ctx context.Context) ([]*Proto, error)
	CreateDashboardsFromProto(ctx context.Context, protoID ID, orgID ID) ([]*Dashboard, error)
}

ProtoService is what dashboard.land will be.

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 Resource ¶

type Resource string

Resource is an enum defining all resources that have a permission model in platform

func (Resource) Valid ¶

func (r Resource) Valid() (err error)

Valid checks if the resource is a member of the Resource enum.

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 {
	Org        *ID
	Task       *ID
	After      *ID
	Limit      int
	AfterTime  string
	BeforeTime string
}

RunFilter represents a set of filters that restrict the returned results

type ScraperTarget ¶

type ScraperTarget struct {
	ID         ID          `json:"id,omitempty"`
	Name       string      `json:"name"`
	Type       ScraperType `json:"type"`
	URL        string      `json:"url"`
	OrgName    string      `json:"org"`
	BucketName string      `json:"bucket"`
}

ScraperTarget is a target to scrape

type ScraperTargetFilter ¶

type ScraperTargetFilter struct {
	ID   *ID     `json:"id"`
	Name *string `json:"name"`
}

ScraperTargetFilter represents a set of filter that restrict the returned results.

type ScraperTargetStoreService ¶

type ScraperTargetStoreService interface {
	ListTargets(ctx context.Context) ([]ScraperTarget, error)
	AddTarget(ctx context.Context, t *ScraperTarget) error
	GetTargetByID(ctx context.Context, id ID) (*ScraperTarget, error)
	RemoveTarget(ctx context.Context, id ID) error
	UpdateTarget(ctx context.Context, t *ScraperTarget) (*ScraperTarget, error)
}

ScraperTargetStoreService defines the crud service for ScraperTarget.

type ScraperType ¶

type ScraperType string

ScraperType defines the scraper methods.

type SecretService ¶

type SecretService interface {
	// LoadSecret retrieves the secret value v found at key k for organization orgID.
	LoadSecret(ctx context.Context, orgID ID, k string) (string, error)

	// GetSecretKeys retrieves all secret keys that are stored for the organization orgID.
	GetSecretKeys(ctx context.Context, orgID ID) ([]string, error)

	// PutSecret stores the secret pair (k,v) for the organization orgID.
	PutSecret(ctx context.Context, orgID ID, k string, v string) error

	// PutSecrets puts all provided secrets and overwrites any previous values.
	PutSecrets(ctx context.Context, orgID ID, m map[string]string) error

	// PatchSecrets patches all provided secrets and updates any previous values.
	PatchSecrets(ctx context.Context, orgID ID, m map[string]string) error

	// DeleteSecret removes a single secret from the secret store.
	DeleteSecret(ctx context.Context, orgID ID, ks ...string) error
}

SecretService a service for storing and retrieving secrets.

type Session ¶

type Session struct {
	// ID is only required for auditing purposes.
	ID          ID           `json:"id"`
	Key         string       `json:"key"`
	CreatedAt   time.Time    `json:"createdAt"`
	ExpiresAt   time.Time    `json:"expiresAt"`
	UserID      ID           `json:"userID,omitempty"`
	Permissions []Permission `json:"permissions,omitempty"`
}

Session is a user session.

func (*Session) Allowed ¶

func (s *Session) Allowed(p Permission) bool

Allowed returns true if the authorization is unexpired and request permission exists in the sessions list of permissions.

func (*Session) Expired ¶

func (s *Session) Expired() error

Expired returns an error if the session is expired.

func (*Session) GetUserID ¶

func (s *Session) GetUserID() ID

GetUserID returns the user id.

func (*Session) Identifier ¶

func (s *Session) Identifier() ID

Identifier returns the sessions ID and is used for auditing.

func (*Session) Kind ¶

func (s *Session) Kind() string

Kind returns session and is used for auditing.

type SessionService ¶

type SessionService interface {
	FindSession(ctx context.Context, key string) (*Session, error)
	ExpireSession(ctx context.Context, key string) error
	CreateSession(ctx context.Context, user string) (*Session, error)
}

SessionService represents a service for managing user sessions.

type SingleStatViewProperties ¶

type SingleStatViewProperties struct {
	Type              string           `json:"type"`
	Queries           []DashboardQuery `json:"queries"`
	Prefix            string           `json:"prefix"`
	Suffix            string           `json:"suffix"`
	ViewColors        []ViewColor      `json:"colors"`
	DecimalPlaces     DecimalPlaces    `json:"decimalPlaces"`
	Note              string           `json:"note"`
	ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

SingleStatViewProperties represents options for single stat view in Chronograf

func (SingleStatViewProperties) GetType ¶

func (v SingleStatViewProperties) GetType() string

type Source ¶

type Source struct {
	ID                 ID         `json:"id,string,omitempty"`          // 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 is used to authorize against an influx 2.0 source.

type SourceQuery ¶

type SourceQuery struct {
	Query string `json:"query"`
	Type  string `json:"type"`
}

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 SourceType ¶

type SourceType string

SourceType is a string for types of 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"`
	SharedSecret       *string     `json:"sharedSecret,omitempty"`
	MetaURL            *string     `json:"metaURL,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 Status ¶

type Status string

Status defines if a resource is active or inactive.

const (
	// Active status means that the resource can be used.
	Active Status = "active"
	// Inactive status means that the resource cannot be used.
	Inactive Status = "inactive"
)

func (Status) Valid ¶

func (s Status) Valid() error

Valid determines if a Status value matches the enum.

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 TableViewProperties ¶

type TableViewProperties struct {
	Type              string           `json:"type"`
	Queries           []DashboardQuery `json:"queries"`
	ViewColors        []ViewColor      `json:"colors"`
	TableOptions      TableOptions     `json:"tableOptions"`
	FieldOptions      []RenamableField `json:"fieldOptions"`
	TimeFormat        string           `json:"timeFormat"`
	DecimalPlaces     DecimalPlaces    `json:"decimalPlaces"`
	Note              string           `json:"note"`
	ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

TableViewProperties represents options for table view in Chronograf

func (TableViewProperties) GetType ¶

func (v TableViewProperties) GetType() string

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"`
	Offset          string `json:"offset,omitempty"`
	LatestCompleted string `json:"latest_completed,omitempty"`
}

Task is a task. 🎊

type TaskFilter ¶

type TaskFilter struct {
	After        *ID
	Organization *ID
	User         *ID
	Limit        int
}

TaskFilter represents a set of filters that restrict the returned results

type TaskService ¶

type TaskService interface {
	// FindTaskByID returns a single task
	FindTaskByID(ctx context.Context, id ID) (*Task, error)

	// FindTasks 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)

	// CreateTask creates a new task.
	CreateTask(ctx context.Context, t *Task) error

	// UpdateTask updates a single task with changeset.
	UpdateTask(ctx context.Context, id ID, upd TaskUpdate) (*Task, error)

	// DeleteTask removes a task by ID and purges all associated data and scheduled runs.
	DeleteTask(ctx context.Context, id ID) error

	// FindLogs returns logs for a run.
	FindLogs(ctx context.Context, filter LogFilter) ([]*Log, int, error)

	// FindRuns 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)

	// FindRunByID returns a single run.
	FindRunByID(ctx context.Context, taskID, runID ID) (*Run, error)

	// CancelRun cancels a currently running run.
	CancelRun(ctx context.Context, taskID, runID ID) error

	// RetryRun creates and returns a new run (which is a retry of another run).
	RetryRun(ctx context.Context, taskID, runID ID) (*Run, error)

	// ForceRun forces a run to occur with unix timestamp scheduledFor, to be executed as soon as possible.
	// The value of scheduledFor may or may not align with the task's schedule.
	ForceRun(ctx context.Context, taskID ID, scheduledFor int64) (*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 TelegrafAgentConfig ¶

type TelegrafAgentConfig struct {
	// Interval at which to gather information in miliseconds.
	Interval int64 `json:"collectionInterval"`
}

TelegrafAgentConfig is based telegraf/internal/config AgentConfig.

type TelegrafConfig ¶

type TelegrafConfig struct {
	ID             ID
	OrganizationID ID
	Name           string

	Agent   TelegrafAgentConfig
	Plugins []TelegrafPlugin
}

TelegrafConfig stores telegraf config for one telegraf instance.

func (*TelegrafConfig) MarshalJSON ¶

func (tc *TelegrafConfig) MarshalJSON() ([]byte, error)

MarshalJSON implement the json.Marshaler interface.

func (TelegrafConfig) TOML ¶

func (tc TelegrafConfig) TOML() string

TOML returns the telegraf toml config string.

func (*TelegrafConfig) UnmarshalJSON ¶

func (tc *TelegrafConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implement the json.Unmarshaler interface.

func (*TelegrafConfig) UnmarshalTOML ¶

func (tc *TelegrafConfig) UnmarshalTOML(data interface{}) error

UnmarshalTOML implements toml.Unmarshaler interface.

type TelegrafConfigFilter ¶

type TelegrafConfigFilter struct {
	OrganizationID *ID
	UserResourceMappingFilter
}

TelegrafConfigFilter represents a set of filter that restrict the returned telegraf configs.

type TelegrafConfigStore ¶

type TelegrafConfigStore interface {
	// UserResourceMappingService must be part of all TelegrafConfigStore service,
	// for create, search, delete.
	UserResourceMappingService

	// FindTelegrafConfigByID returns a single telegraf config by ID.
	FindTelegrafConfigByID(ctx context.Context, id ID) (*TelegrafConfig, error)

	// FindTelegrafConfig returns the first telegraf config that matches filter.
	FindTelegrafConfig(ctx context.Context, filter TelegrafConfigFilter) (*TelegrafConfig, error)

	// FindTelegrafConfigs returns a list of telegraf configs that match filter and the total count of matching telegraf configs.
	// Additional options provide pagination & sorting.
	FindTelegrafConfigs(ctx context.Context, filter TelegrafConfigFilter, opt ...FindOptions) ([]*TelegrafConfig, int, error)

	// CreateTelegrafConfig creates a new telegraf config and sets b.ID with the new identifier.
	CreateTelegrafConfig(ctx context.Context, tc *TelegrafConfig, userID ID) error

	// UpdateTelegrafConfig updates a single telegraf config.
	// Returns the new telegraf config after update.
	UpdateTelegrafConfig(ctx context.Context, id ID, tc *TelegrafConfig, userID ID) (*TelegrafConfig, error)

	// DeleteTelegrafConfig removes a telegraf config by ID.
	DeleteTelegrafConfig(ctx context.Context, id ID) error
}

TelegrafConfigStore represents a service for managing telegraf config data.

type TelegrafPlugin ¶

type TelegrafPlugin struct {
	Comment string         `json:"comment"`
	Config  plugins.Config `json:"config"`
}

TelegrafPlugin is the general wrapper of the telegraf plugin config

type Timespan ¶

type Timespan struct {
	Start time.Time `json:"start"`
	Stop  time.Time `json:"stop"`
}

Timespan represents a range of time.

type TokenGenerator ¶

type TokenGenerator interface {
	// Token generates a new API token.
	Token() (string, error)
}

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 ¶

type UsageFilter struct {
	OrgID    *ID
	BucketID *ID
	Range    *Timespan
}

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 write bytes.
	UsageWriteRequestBytes UsageMetric = "usage_write_request_bytes"

	// UsageValues is the name of the metrics for tracking the number of values.
	UsageValues UsageMetric = "usage_values"
	// UsageSeries is the name of the metrics for tracking the number of series written.
	UsageSeries UsageMetric = "usage_series"

	// UsageQueryRequestCount is the name of the metrics for tracking query request count.
	UsageQueryRequestCount UsageMetric = "usage_query_request_count"
	// UsageQueryRequestBytes is the name of the metrics for tracking the number of query bytes.
	UsageQueryRequestBytes UsageMetric = "usage_query_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 User ¶

type User struct {
	ID   ID     `json:"id,omitempty"`
	Name string `json:"name"`
}

User is a user. 🎉

type UserFilter ¶

type UserFilter struct {
	ID   *ID
	Name *string
}

UserFilter represents a set of filter that restrict the returned results.

type UserOperationLogService ¶

type UserOperationLogService interface {
	// GetUserOperationLog retrieves the operation log for the user with the provided id.
	GetUserOperationLog(ctx context.Context, id ID, opts FindOptions) ([]*OperationLogEntry, int, error)
}

UserOperationLogService is an interface for retrieving the operation log for a user.

type UserResourceMapping ¶

type UserResourceMapping struct {
	UserID     ID       `json:"userID"`
	UserType   UserType `json:"userType"`
	Resource   Resource `json:"resource"`
	ResourceID ID       `json:"resourceID"`
}

UserResourceMapping represents a mapping of a resource to its user.

func (*UserResourceMapping) ToPermissions ¶

func (m *UserResourceMapping) ToPermissions() ([]Permission, error)

ToPermissions converts a user resource mapping into a set of permissions.

func (UserResourceMapping) Validate ¶

func (m UserResourceMapping) Validate() error

Validate reports any validation errors for the mapping.

type UserResourceMappingFilter ¶

type UserResourceMappingFilter struct {
	ResourceID ID
	Resource   Resource
	UserID     ID
	UserType   UserType
}

UserResourceMappingFilter represents a set of filters that restrict the returned results.

type UserResourceMappingService ¶

type UserResourceMappingService interface {
	// FindUserResourceMappings returns a list of UserResourceMappings that match filter and the total count of matching mappings.
	FindUserResourceMappings(ctx context.Context, filter UserResourceMappingFilter, opt ...FindOptions) ([]*UserResourceMapping, int, error)

	// CreateUserResourceMapping creates a user resource mapping.
	CreateUserResourceMapping(ctx context.Context, m *UserResourceMapping) error

	// DeleteUserResourceMapping deletes a user resource mapping.
	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 UserType ¶

type UserType string

UserType can either be owner or member.

const (
	// Owner can read and write to a resource
	Owner UserType = "owner" // 1
	// Member can read from a resource.
	Member UserType = "member" // 2
)

func (UserType) Valid ¶

func (ut UserType) Valid() (err error)

Valid checks if the UserType is a member of the UserType enum

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
	SharedSecret string `json:"sharedSecret,omitempty"` // ShareSecret is the optional signing secret for Influx JWT authorization
	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
}

V1SourceFields are the fields for connecting to a 1.0 source (oss or enterprise)

type View ¶

type View struct {
	ViewContents
	Properties ViewProperties
}

View holds positional and visual information for a View.

func (View) MarshalJSON ¶

func (c View) MarshalJSON() ([]byte, error)

MarshalJSON encodes a view to JSON bytes.

func (*View) UnmarshalJSON ¶

func (c *View) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes JSON bytes into the corresponding view type (those that implement ViewProperties).

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 float64 `json:"value"` // Value is the data value mapped to this color
}

ViewColor represents the encoding of data into visualizations

type ViewContents ¶

type ViewContents struct {
	ID   ID     `json:"id,omitempty"`
	Name string `json:"name"`
}

ViewContents is the id and name of a specific view.

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
	Types []string
}

ViewFilter represents a set of filter that restrict the returned results.

type ViewProperties ¶

type ViewProperties interface {
	GetType() string
	// contains filtered or unexported methods
}

ViewProperties is used to mark other structures as conforming to a View.

func UnmarshalViewPropertiesJSON ¶

func UnmarshalViewPropertiesJSON(b []byte) (ViewProperties, error)

UnmarshalViewPropertiesJSON unmarshals JSON bytes into a ViewProperties.

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
}

NOTE: This service has been DEPRECATED and should be removed. Views are now resources that are nested beneath dashboards.

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) Apply ¶

func (u ViewUpdate) Apply(v *View) error

Apply updates a view with the view updates properties.

func (ViewUpdate) MarshalJSON ¶

func (u ViewUpdate) MarshalJSON() ([]byte, error)

MarshalJSON encodes a view to JSON bytes.

func (*ViewUpdate) UnmarshalJSON ¶

func (u *ViewUpdate) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes JSON bytes into the corresponding view update type (those that implement ViewProperties).

func (ViewUpdate) Valid ¶

func (u ViewUpdate) Valid() *Error

Valid validates the update struct. It expects minimal values to be set.

type WriteService ¶

type WriteService interface {
	Write(ctx context.Context, org, bucket ID, r io.Reader) error
}

WriteService writes data read from the reader.

type XYViewProperties ¶

type XYViewProperties struct {
	Queries           []DashboardQuery `json:"queries"`
	Axes              map[string]Axis  `json:"axes"`
	Type              string           `json:"type"`
	Legend            Legend           `json:"legend"`
	Geom              string           `json:"geom"` // Either "line", "step", "stacked", or "bar"
	ViewColors        []ViewColor      `json:"colors"`
	Note              string           `json:"note"`
	ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

XYViewProperties represents options for line, bar, step, or stacked view in Chronograf

func (XYViewProperties) GetType ¶

func (v XYViewProperties) GetType() string

Directories ¶

Path Synopsis
id
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
influx_inspect/buildtsi
Package buildtsi reads an in-memory index and exports it as a TSI index.
Package buildtsi reads an in-memory index and exports it as a TSI index.
NOTE: This service has been deprecated and should not be used.
NOTE: This service has been deprecated and should not be used.
internal
fs
kit
check
Package check standardizes /health and /ready endpoints.
Package check standardizes /health and /ready endpoints.
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.
Note: this file is used as a proof of concept for having a generic keyvalue store backed by specific implementations of kv.Store.
Note: this file is used as a proof of concept for having a generic keyvalue store backed by specific implementations of kv.Store.
Package models implements basic objects used throughout the TICK stack.
Package models implements basic objects used throughout the TICK stack.
pkg
deep
Package deep provides a deep equality check for use in tests.
Package deep provides a deep equality check for use in tests.
encoding/simple8b
Package simple8b implements the 64bit integer encoding algoritm as published by Ann and Moffat in "Index compression using 64-bit words", Softw.
Package simple8b implements the 64bit integer encoding algoritm as published by Ann and Moffat in "Index compression using 64-bit words", Softw.
escape
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.
estimator/hll
Package hll contains a HyperLogLog++ with a LogLog-Beta bias correction implementation that is adapted (mostly copied) from an implementation provided by Clark DuVall github.com/clarkduvall/hyperloglog.
Package hll contains a HyperLogLog++ with a LogLog-Beta bias correction implementation that is adapted (mostly copied) from an implementation provided by Clark DuVall github.com/clarkduvall/hyperloglog.
limiter
Package limiter provides concurrency limiters.
Package limiter provides concurrency limiters.
metrics
Package metrics provides various measurements that are safe for concurrent access.
Package metrics provides various measurements that are safe for concurrent access.
mmap
Package mmap provides a way to memory-map a file.
Package mmap provides a way to memory-map a file.
pool
Package pool provides pool structures to help reduce garbage collector pressure.
Package pool provides pool structures to help reduce garbage collector pressure.
rhh
slices
Package slices contains functions to operate on slices treated as sets.
Package slices contains functions to operate on slices treated as sets.
testing/assert
Package assert provides helper functions that can be used with the standard Go testing package.
Package assert provides helper functions that can be used with the standard Go testing 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.
control
Package control provides a query controller.
Package control provides a query controller.
functions/inputs/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.
options
Package options implements flux options.
Package options implements flux options.
promql
Package promql implements a promql parser to build flux query specifications from promql.
Package promql implements a promql parser to build flux query specifications from promql.
compat
package compat helps with migrating toml files from influxdb.
package compat helps with migrating toml files from influxdb.
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.
servicetest
Package servicetest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of platform.TaskService.
Package servicetest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of platform.TaskService.
telegraf
Package toml adds support to marshal and unmarshal types not in the official TOML spec.
Package toml adds support to marshal and unmarshal types not in the official TOML spec.
tools
tsi1
Package tsi1 provides a memory-mapped index implementation that supports high cardinality series.
Package tsi1 provides a memory-mapped index implementation that supports high cardinality series.
tsm1
Package tsm1 provides a TSDB in the Time Structured Merge tree format.
Package tsm1 provides a TSDB in the Time Structured Merge tree format.
Package uuid provides functions to create time-based UUIDs.
Package uuid provides functions to create time-based UUIDs.

Jump to

Keyboard shortcuts

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