influxdb: github.com/influxdata/influxdb Index | Files | Directories

package influxdb

import "github.com/influxdata/influxdb"

Index

Package Files

auth.go authz.go backup.go bucket.go build.go check.go crud_log.go dashboard.go dbrp_mapping.go delete.go document.go duration.go error.go errors.go id.go keyvalue_log.go label.go lookup.go measurement.go notification.go notification_endpoint.go onboarding.go operation_log.go organization.go paging.go passwords.go query.go scraper.go secret.go semaphore.go session.go source.go status.go tag.go task.go task_errors.go telegraf.go tenant.go token.go usage.go user.go user_resource_mapping.go variable.go write.go

Constants

const (
    OpFindAuthorizationByID    = "FindAuthorizationByID"
    OpFindAuthorizationByToken = "FindAuthorizationByToken"
    OpFindAuthorizations       = "FindAuthorizations"
    OpCreateAuthorization      = "CreateAuthorization"
    OpUpdateAuthorization      = "UpdateAuthorization"
    OpDeleteAuthorization      = "DeleteAuthorization"
)

auth service op

const (
    // AuthorizationsResourceType gives permissions to one or more authorizations.
    AuthorizationsResourceType = ResourceType("authorizations") // 0
    // BucketsResourceType gives permissions to one or more buckets.
    BucketsResourceType = ResourceType("buckets") // 1
    // DashboardsResourceType gives permissions to one or more dashboards.
    DashboardsResourceType = ResourceType("dashboards") // 2
    // OrgsResourceType gives permissions to one or more orgs.
    OrgsResourceType = ResourceType("orgs") // 3
    // SourcesResourceType gives permissions to one or more sources.
    SourcesResourceType = ResourceType("sources") // 4
    // TasksResourceType gives permissions to one or more tasks.
    TasksResourceType = ResourceType("tasks") // 5
    // TelegrafsResourceType type gives permissions to a one or more telegrafs.
    TelegrafsResourceType = ResourceType("telegrafs") // 6
    // UsersResourceType gives permissions to one or more users.
    UsersResourceType = ResourceType("users") // 7
    // VariablesResourceType gives permission to one or more variables.
    VariablesResourceType = ResourceType("variables") // 8
    // ScraperResourceType gives permission to one or more scrapers.
    ScraperResourceType = ResourceType("scrapers") // 9
    // SecretsResourceType gives permission to one or more secrets.
    SecretsResourceType = ResourceType("secrets") // 10
    // LabelsResourceType gives permission to one or more labels.
    LabelsResourceType = ResourceType("labels") // 11
    // ViewsResourceType gives permission to one or more views.
    ViewsResourceType = ResourceType("views") // 12
    // DocumentsResourceType gives permission to one or more documents.
    DocumentsResourceType = ResourceType("documents") // 13
    // NotificationRuleResourceType gives permission to one or more notificationRules.
    NotificationRuleResourceType = ResourceType("notificationRules") // 14
    // NotificationEndpointResourceType gives permission to one or more notificationEndpoints.
    NotificationEndpointResourceType = ResourceType("notificationEndpoints") // 15
    // ChecksResourceType gives permission to one or more Checks.
    ChecksResourceType = ResourceType("checks") // 16
    // DBRPType gives permission to one or more DBRPs.
    DBRPResourceType = ResourceType("dbrp") // 17
)
const (
    // BucketTypeUser is a user created bucket
    BucketTypeUser = BucketType(0)
    // BucketTypeSystem is an internally created bucket that cannot be deleted/renamed.
    BucketTypeSystem = BucketType(1)
    // MonitoringSystemBucketRetention is the time we should retain monitoring system bucket information
    MonitoringSystemBucketRetention = time.Hour * 24 * 7
    // TasksSystemBucketRetention is the time we should retain task system bucket information
    TasksSystemBucketRetention = time.Hour * 24 * 3
)
const (
    TasksSystemBucketName      = "_tasks"
    MonitoringSystemBucketName = "_monitoring"
)

Bucket names constants

const (
    CheckDefaultPageSize = 100
    CheckMaxPageSize     = 500
)

consts for checks config.

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.

const (
    ViewPropertyTypeCheck              = "check"
    ViewPropertyTypeGauge              = "gauge"
    ViewPropertyTypeHeatMap            = "heatmap"
    ViewPropertyTypeHistogram          = "histogram"
    ViewPropertyTypeLogViewer          = "log-viewer"
    ViewPropertyTypeMarkdown           = "markdown"
    ViewPropertyTypeScatter            = "scatter"
    ViewPropertyTypeSingleStat         = "single-stat"
    ViewPropertyTypeSingleStatPlusLine = "line-plus-single-stat"
    ViewPropertyTypeTable              = "table"
    ViewPropertyTypeXY                 = "xy"
    ViewPropertyTypeMosaic             = "mosaic"
    ViewPropertyTypeBand               = "band"
)

Values for all supported view property types.

const (
    EInternal            = "internal error"
    ENotFound            = "not found"
    EConflict            = "conflict"             // action cannot be performed
    EInvalid             = "invalid"              // validation failed
    EUnprocessableEntity = "unprocessable entity" // data type is correct, but out of range
    EEmptyValue          = "empty value"
    EUnavailable         = "unavailable"
    EForbidden           = "forbidden"
    ETooManyRequests     = "too many requests"
    EUnauthorized        = "unauthorized"
    EMethodNotAllowed    = "method not allowed"
    ETooLarge            = "request too large"
)

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. Any time this set of constants changes, you must also update the swagger for Error.properties.code.enum.

const (
    OpFindLabels         = "FindLabels"
    OpFindLabelByID      = "FindLabelByID"
    OpFindLabelMapping   = "FindLabelMapping"
    OpCreateLabel        = "CreateLabel"
    OpCreateLabelMapping = "CreateLabelMapping"
    OpUpdateLabel        = "UpdateLabel"
    OpDeleteLabel        = "DeleteLabel"
    OpDeleteLabelMapping = "DeleteLabelMapping"
)
const (
    OrgIDLength       = 8
    BucketIDLength    = 8
    MeasurementLength = OrgIDLength + BucketIDLength
)

Length of components of measurement names.

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

ops for orgs error and orgs op logs.

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

ops for ScraperTarget Store

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

ops for sources.

const (
    TaskDefaultPageSize = 100
    TaskMaxPageSize     = 500

    TaskStatusActive   = "active"
    TaskStatusInactive = "inactive"
)
const (
    ErrTelegrafConfigInvalidOrgID  = "invalid org ID"                   // ErrTelegrafConfigInvalidOrgID is the error message for a missing or invalid organization ID.
    ErrTelegrafConfigNotFound      = "telegraf configuration not found" // ErrTelegrafConfigNotFound is the error message for a missing telegraf config.
    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"
)
const (
    OpFindUserByID = "FindUserByID"
    OpFindUser     = "FindUser"
    OpFindUsers    = "FindUsers"
    OpCreateUser   = "CreateUser"
    OpUpdateUser   = "UpdateUser"
    OpDeleteUser   = "DeleteUser"
)

Ops for user errors and op log.

const (
    UserMappingType = 0
    OrgMappingType  = 1
)
const (
    OpFindVariableByID = "FindVariableByID"
    OpFindVariables    = "FindVariables"
    OpCreateVariable   = "CreateVariable"
    OpUpdateVariable   = "UpdateVariable"
    OpReplaceVariable  = "ReplaceVariable"
    OpDeleteVariable   = "DeleteVariable"
)

ops for variable error.

const AuthorizationKind = "authorization"

AuthorizationKind is returned by (*Authorization).Kind().

const DefaultLeaseTTL = time.Minute

DefaultLeaseTTL is used when a specific lease TTL is not requested.

const ErrCellNotFound = "cell not found"

ErrCellNotFound is the error msg for a missing cell.

const ErrDashboardNotFound = "dashboard not found"

ErrDashboardNotFound is the error msg for a missing dashboard.

const ErrDocumentNotFound = "document not found"

ErrDocumentNotFound is the error msg for a missing document.

const ErrLabelNotFound = "label not found"

ErrLabelNotFound is the error for a missing Label.

const ErrScraperTargetNotFound = "scraper target not found"

ErrScraperTargetNotFound is the error msg for a missing scraper target.

const ErrSecretNotFound = "secret not found"

ErrSecretNotFound is the error msg for a missing secret.

const ErrSessionExpired = "session has expired"

ErrSessionExpired is the error message for expired sessions.

const ErrSessionNotFound = "session not found"

ErrSessionNotFound is the error messages for a missing sessions.

const (
    // ErrSourceNotFound is an error message when a source does not exist.
    ErrSourceNotFound = "source not found"
)
const ErrVariableNotFound = "variable not found"

ErrVariableNotFound is the error msg for a missing variable.

const ErrViewNotFound = "view not found"

ErrViewNotFound is the error msg for a missing View.

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.

const InfiniteRetention = 0

InfiniteRetention is default infinite retention period.

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

Scraper types

const SessionAuthorizionKind = "session"

SessionAuthorizionKind defines the type of authorizer

Variables

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")
    // ErrInvalidResourceType notes that the provided resource is invalid
    ErrInvalidResourceType = errors.New("unknown resource type for permission")
    // ErrInvalidAction notes that the provided action is invalid
    ErrInvalidAction = errors.New("unknown action for permission")
)
var (
    OpFindBucketByID = "FindBucketByID"
    OpFindBucket     = "FindBucket"
    OpFindBuckets    = "FindBuckets"
    OpCreateBucket   = "CreateBucket"
    OpPutBucket      = "PutBucket"
    OpUpdateBucket   = "UpdateBucket"
    OpDeleteBucket   = "DeleteBucket"
)

ops for buckets error and buckets op logs.

var (
    OpFindCheckByID = "FindCheckByID"
    OpFindCheck     = "FindCheck"
    OpFindChecks    = "FindChecks"
    OpCreateCheck   = "CreateCheck"
    OpUpdateCheck   = "UpdateCheck"
    OpDeleteCheck   = "DeleteCheck"
)

ops for checks error

var (
    // ErrInvalidID signifies invalid IDs.
    ErrInvalidID = &Error{
        Code: EInvalid,
        Msg:  "invalid ID",
    }

    // ErrInvalidIDLength is returned when an ID has the incorrect number of bytes.
    ErrInvalidIDLength = &Error{
        Code: EInvalid,
        Msg:  "id must have a length of 16 bytes",
    }
)
var (
    // ErrLabelNameisEmpty is error when org name is empty
    ErrLabelNameisEmpty = &Error{
        Code: EInvalid,
        Msg:  "label name is empty",
    }

    // ErrLabelExistsOnResource is used when attempting to add a label to a resource
    // when that label already exists on the resource
    ErrLabelExistsOnResource = &Error{
        Code: EConflict,
        Msg:  "Cannot add label, label already exists on resource",
    }
)

errors on label

var (
    OpFindNotificationEndpointByID = "FindNotificationEndpointByID"
    OpFindNotificationEndpoint     = "FindNotificationEndpoint"
    OpFindNotificationEndpoints    = "FindNotificationEndpoints"
    OpCreateNotificationEndpoint   = "CreateNotificationEndpoint"
    OpUpdateNotificationEndpoint   = "UpdateNotificationEndpoint"
    OpDeleteNotificationEndpoint   = "DeleteNotificationEndpoint"
)

ops for checks error

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"
    // OpRenewSession = "RenewSession"
    OpRenewSession = "RenewSession"
)
var (
    // ErrRunCanceled is returned from the RunResult when a Run is Canceled.  It is used mostly internally.
    ErrRunCanceled = &Error{
        Code: EInternal,
        Msg:  "run canceled",
    }

    // ErrTaskNotClaimed is returned when attempting to operate against a task that must be claimed but is not.
    ErrTaskNotClaimed = &Error{
        Code: EConflict,
        Msg:  "task not claimed",
    }

    // ErrTaskAlreadyClaimed is returned when attempting to operate against a task that must not be claimed but is.
    ErrTaskAlreadyClaimed = &Error{
        Code: EConflict,
        Msg:  "task already claimed",
    }

    // ErrNoRunsFound is returned when searching for a range of runs, but none are found.
    ErrNoRunsFound = &Error{
        Code: ENotFound,
        Msg:  "no matching runs found",
    }

    // ErrInvalidTaskID error object for bad id's
    ErrInvalidTaskID = &Error{
        Code: EInvalid,
        Msg:  "invalid id",
    }

    // ErrTaskNotFound indicates no task could be found for given parameters.
    ErrTaskNotFound = &Error{
        Code: ENotFound,
        Msg:  "task not found",
    }

    // ErrRunNotFound is returned when searching for a single run that doesn't exist.
    ErrRunNotFound = &Error{
        Code: ENotFound,
        Msg:  "run not found",
    }

    ErrRunKeyNotFound = &Error{
        Code: ENotFound,
        Msg:  "run key not found",
    }

    ErrPageSizeTooSmall = &Error{
        Msg:  "cannot have negative page limit",
        Code: EInvalid,
    }

    // ErrPageSizeTooLarge indicates the page size is too large. This error is only
    // used in the kv task service implementation. The name of this error may lead it
    // to be used in a place that is not useful. The TaskMaxPageSize is the only one
    // at 500, the rest at 100. This would likely benefit from a more specific name
    // since those limits aren't shared globally.
    ErrPageSizeTooLarge = &Error{
        Msg:  fmt.Sprintf("cannot use page size larger then %d", TaskMaxPageSize),
        Code: EInvalid,
    }

    ErrOrgNotFound = &Error{
        Msg:  "organization not found",
        Code: ENotFound,
    }

    ErrTaskRunAlreadyQueued = &Error{
        Msg:  "run already queued",
        Code: EConflict,
    }

    // ErrOutOfBoundsLimit is returned with FindRuns is called with an invalid filter limit.
    ErrOutOfBoundsLimit = &Error{
        Code: EUnprocessableEntity,
        Msg:  "run limit is out of bounds, must be between 1 and 500",
    }

    // ErrInvalidOwnerID is called when trying to create a task with out a valid ownerID
    ErrInvalidOwnerID = &Error{
        Code: EInvalid,
        Msg:  "cannot create task with invalid ownerID",
    }
)
var (
    OpFindTelegrafConfigByID = "FindTelegrafConfigByID"
    OpFindTelegrafConfigs    = "FindTelegrafConfigs"
    OpCreateTelegrafConfig   = "CreateTelegrafConfig"
    OpUpdateTelegrafConfig   = "UpdateTelegrafConfig"
    OpDeleteTelegrafConfig   = "DeleteTelegrafConfig"
)

ops for buckets error and buckets op logs.

var (
    // ErrInvalidUserType notes that the provided UserType is invalid
    ErrInvalidUserType = errors.New("unknown user type")
    // ErrInvalidMappingType notes that the provided MappingType is invalid
    ErrInvalidMappingType = errors.New("unknown mapping 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")
)
var AllResourceTypes = []ResourceType{
    AuthorizationsResourceType,
    BucketsResourceType,
    DashboardsResourceType,
    OrgsResourceType,
    SourcesResourceType,
    TasksResourceType,
    TelegrafsResourceType,
    UsersResourceType,
    VariablesResourceType,
    ScraperResourceType,
    SecretsResourceType,
    LabelsResourceType,
    ViewsResourceType,
    DocumentsResourceType,
    NotificationRuleResourceType,
    NotificationEndpointResourceType,
    ChecksResourceType,
    DBRPResourceType,
}

AllResourceTypes is the list of all known resource types.

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

DefaultDashboardFindOptions are the default find options for dashboards

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

DefaultOperationLogFindOptions are the default options for the operation log.

var DefaultSessionLength = time.Hour

DefaultSessionLength is the default session length on initial creation.

var DefaultSourceFindOptions = FindOptions{}

DefaultSourceFindOptions are the default find options for sources

var DefaultVariableFindOptions = FindOptions{}

DefaultVariableFindOptions are the default find options for variables.

var (
    // ErrInvalidNotificationEndpointType denotes that the provided NotificationEndpoint is not a valid type
    ErrInvalidNotificationEndpointType = errors.New("unknown notification endpoint type")
)
var ErrInvalidOrgFilter = &Error{
    Code: EInvalid,
    Msg:  "Please provide either orgID or org",
}

ErrInvalidOrgFilter is the error indicate org filter is empty

var ErrNoAcquire = errors.New("ownership not acquired")

ErrNoAcquire is returned when it was not possible to acquire ownership of the semaphore.

var (
    // ErrOrgNameisEmpty is error when org name is empty
    ErrOrgNameisEmpty = &Error{
        Code: EInvalid,
        Msg:  "org name is empty",
    }
)

errors of org

var ErrUnableToCreateToken = &Error{
    Msg:  "unable to create token",
    Code: EInvalid,
}

ErrUnableToCreateToken sanitized error message for all errors when a user cannot create a token

var OrgResourceTypes = []ResourceType{
    BucketsResourceType,
    DashboardsResourceType,
    SourcesResourceType,
    TasksResourceType,
    TelegrafsResourceType,
    UsersResourceType,
    VariablesResourceType,
    SecretsResourceType,
    DocumentsResourceType,
    NotificationRuleResourceType,
    NotificationEndpointResourceType,
    ChecksResourceType,
    DBRPResourceType,
}

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

var RenewSessionTime = time.Duration(time.Second * 300)

RenewSessionTime is the the time to extend session, currently set to 5min.

var (
    // TaskSystemType is the type set in tasks' for all crud requests
    TaskSystemType = "system"
)

func CreateMeasurement Uses

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 Uses

func ErrorCode(err error) string

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

func ErrorMessage Uses

func ErrorMessage(err error) string

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

func ErrorOp Uses

func ErrorOp(err error) string

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

func FindOptionParams Uses

func FindOptionParams(opts ...FindOptions) [][2]string

func IsActive Uses

func IsActive(a *Authorization) bool

IsActive is a stub for idpe.

func MarshalViewPropertiesJSON Uses

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

MarshalViewPropertiesJSON encodes a view into JSON bytes.

func NewBuilderTag Uses

func NewBuilderTag(key string, functionType string, values ...string) struct {
    Key                   string   `json:"key"`
    Values                []string `json:"values"`
    AggregateFunctionType string   `json:"aggregateFunctionType"`
}

NewBuilderTag is a constructor for the builder config types. This isn't technically required, but working with struct literals with embedded struct tags is really painful. This is to get around that bit. Would be nicer to have these as actual types maybe.

func PermissionAllowed Uses

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

PermissionAllowed determines if a permission is allowed.

func ReadMeasurement Uses

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 SetBuildInfo Uses

func SetBuildInfo(version, commit, date string)

SetBuildInfo sets the build information for the binary.

func SortDashboards Uses

func SortDashboards(opts FindOptions, ds []*Dashboard)

SortDashboards sorts a slice of dashboards by a field.

func ValidScraperType Uses

func ValidScraperType(s string) bool

ValidScraperType returns true is the type string is valid

func WhereOrg Uses

func WhereOrg(org string) func(DocumentIndex, DocumentDecorator) ([]ID, error)

WhereOrg retrieves a list of the ids of the documents that belong to the provided org.

func WhereOrgID Uses

func WhereOrgID(orgID ID) func(DocumentIndex, DocumentDecorator) ([]ID, error)

WhereOrgID retrieves a list of the ids of the documents that belong to the provided orgID.

func WithErrorCode Uses

func WithErrorCode(code string) func(*Error)

WithErrorCode sets the code on the error.

func WithErrorErr Uses

func WithErrorErr(err error) func(*Error)

WithErrorErr sets the err on the error.

func WithErrorMsg Uses

func WithErrorMsg(msg string) func(*Error)

WithErrorMsg sets the message on the error.

func WithErrorOp Uses

func WithErrorOp(op string) func(*Error)

WithErrorOp sets the message on the error.

type Action Uses

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 Uses

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

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

type AddDashboardCellOptions Uses

type AddDashboardCellOptions struct {
    View *View
}

AddDashboardCellOptions are options for adding a dashboard.

type Authorization Uses

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,omitempty"`
    Permissions []Permission `json:"permissions"`
    CRUDLog
}

Authorization is an authorization. 🎉

func (*Authorization) GetUserID Uses

func (a *Authorization) GetUserID() ID

GetUserID returns the user id.

func (*Authorization) Identifier Uses

func (a *Authorization) Identifier() ID

Identifier returns the authorizations ID and is used for auditing.

func (*Authorization) IsActive Uses

func (a *Authorization) IsActive() bool

IsActive returns true if the authorization active.

func (*Authorization) Kind Uses

func (a *Authorization) Kind() string

Kind returns session and is used for auditing.

func (*Authorization) PermissionSet Uses

func (a *Authorization) PermissionSet() (PermissionSet, error)

PermissionSet returns the set of permissions associated with the Authorization.

func (*Authorization) Valid Uses

func (a *Authorization) Valid() error

Valid ensures that the authorization is valid.

type AuthorizationFilter Uses

type AuthorizationFilter struct {
    Token *string
    ID    *ID

    UserID *ID
    User   *string

    OrgID *ID
    Org   *string
}

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

type AuthorizationService Uses

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

    // UpdateAuthorization updates the status and description if available.
    UpdateAuthorization(ctx context.Context, id ID, upd *AuthorizationUpdate) (*Authorization, error)

    // Removes a authorization by token.
    DeleteAuthorization(ctx context.Context, id ID) error
}

AuthorizationService represents a service for managing authorization data.

type AuthorizationUpdate Uses

type AuthorizationUpdate struct {
    Status      *Status `json:"status,omitempty"`
    Description *string `json:"description,omitempty"`
}

AuthorizationUpdate is the authorization update request.

type Authorizer Uses

type Authorizer interface {
    // PermissionSet returns the PermissionSet associated with the authorizer
    PermissionSet() (PermissionSet, error)

    // 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 Uses

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 BackupService Uses

type BackupService interface {
    // CreateBackup creates a local copy (hard links) of the TSM data for all orgs and buckets.
    // The return values are used to download each backup file.
    CreateBackup(context.Context) (backupID int, backupFiles []string, err error)
    // FetchBackupFile downloads one backup file, data or metadata.
    FetchBackupFile(ctx context.Context, backupID int, backupFile string, w io.Writer) error
    // InternalBackupPath is a utility to determine the on-disk location of a backup fileset.
    InternalBackupPath(backupID int) string
}

BackupService represents the data backup functions of InfluxDB.

type BandViewProperties Uses

type BandViewProperties struct {
    Queries           []DashboardQuery `json:"queries"`
    Axes              map[string]Axis  `json:"axes"`
    Type              string           `json:"type"`
    Legend            Legend           `json:"legend"`
    Geom              string           `json:"geom"`
    ViewColors        []ViewColor      `json:"colors"`
    Note              string           `json:"note"`
    ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
    TimeFormat        string           `json:"timeFormat"`
    HoverDimension    string           `json:"hoverDimension"`
    XColumn           string           `json:"xColumn"`
    YColumn           string           `json:"yColumn"`
    UpperColumn       string           `json:"upperColumn"`
    MainColumn        string           `json:"mainColumn"`
    LowerColumn       string           `json:"lowerColumn"`
}

BandViewProperties represents options for the band view

func (BandViewProperties) GetType Uses

func (v BandViewProperties) GetType() string

type Bucket Uses

type Bucket struct {
    ID                  ID            `json:"id,omitempty"`
    OrgID               ID            `json:"orgID,omitempty"`
    Type                BucketType    `json:"type"`
    Name                string        `json:"name"`
    Description         string        `json:"description"`
    RetentionPolicyName string        `json:"rp,omitempty"` // This to support v1 sources
    RetentionPeriod     time.Duration `json:"retentionPeriod"`
    CRUDLog
}

Bucket is a bucket. 🎉

type BucketFilter Uses

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

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

func (BucketFilter) QueryParams Uses

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

QueryParams Converts BucketFilter fields to url query params.

func (BucketFilter) String Uses

func (f BucketFilter) String() string

String returns a human-readable string of the BucketFilter, particularly useful for error messages.

type BucketOperationLogService Uses

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 Uses

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
    FindBucketByName(ctx context.Context, orgID ID, name string) (*Bucket, error)
}

BucketService represents a service for managing bucket data.

type BucketType Uses

type BucketType int

BucketType differentiates system buckets from user buckets.

func ParseBucketType Uses

func ParseBucketType(s string) BucketType

ParseBucketType parses a bucket type from a string

func (BucketType) String Uses

func (bt BucketType) String() string

String converts a BucketType into a human-readable string.

type BucketUpdate Uses

type BucketUpdate struct {
    Name            *string        `json:"name,omitempty"`
    Description     *string        `json:"description,omitempty"`
    RetentionPeriod *time.Duration `json:"retentionPeriod,omitempty"`
}

BucketUpdate represents updates to a bucket. Only fields which are set are updated.

type BuildInfo Uses

type BuildInfo struct {
    Version string // Version is the current git tag with v prefix stripped
    Commit  string // Commit is the current git commit SHA
    Date    string // Date is the build date in RFC3339
}

BuildInfo represents the information about InfluxDB build.

func GetBuildInfo Uses

func GetBuildInfo() BuildInfo

GetBuildInfo returns the current build information for the binary.

type BuilderConfig Uses

type BuilderConfig struct {
    Buckets []string `json:"buckets"`
    Tags    []struct {
        Key                   string   `json:"key"`
        Values                []string `json:"values"`
        AggregateFunctionType string   `json:"aggregateFunctionType"`
    }   `json:"tags"`
    Functions []struct {
        Name string `json:"name"`
    }   `json:"functions"`
    AggregateWindow struct {
        Period     string `json:"period"`
        FillValues bool   `json:"fillValues"`
    }   `json:"aggregateWindow"`
}

func (BuilderConfig) MarshalJSON Uses

func (b BuilderConfig) MarshalJSON() ([]byte, error)

MarshalJSON is necessary for the time being. UI keeps breaking b/c it relies on these slices being populated/not nil. Other consumers may have same issue.

type CRUDLog Uses

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

CRUDLog is the struct to store crud related ops.

func (*CRUDLog) SetCreatedAt Uses

func (log *CRUDLog) SetCreatedAt(now time.Time)

SetCreatedAt set the created time.

func (*CRUDLog) SetUpdatedAt Uses

func (log *CRUDLog) SetUpdatedAt(now time.Time)

SetUpdatedAt set the updated time.

type CRUDLogSetter Uses

type CRUDLogSetter interface {
    SetCreatedAt(now time.Time)
    SetUpdatedAt(now time.Time)
}

CRUDLogSetter is the interface to set the crudlog.

type Cell Uses

type Cell struct {
    ID  ID  `json:"id,omitempty"`
    CellProperty
    View *View `json:"-"`
}

Cell holds positional information about a cell on dashboard and a reference to a cell.

func (*Cell) MarshalJSON Uses

func (c *Cell) MarshalJSON() ([]byte, error)

Marshals the cell

func (*Cell) UnmarshalJSON Uses

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

type CellProperty Uses

type CellProperty struct {
    X   int32 `json:"x"`
    Y   int32 `json:"y"`
    W   int32 `json:"w"`
    H   int32 `json:"h"`
}

CellProperty contains the properties of a cell.

type CellUpdate Uses

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 Uses

func (u CellUpdate) Apply(c *Cell) error

Apply applies an update to a Cell.

func (CellUpdate) Valid Uses

func (u CellUpdate) Valid() *Error

Valid returns an error if the cell update is invalid.

type Check Uses

type Check interface {
    Valid(lang FluxLanguageService) error
    Type() string
    ClearPrivateData()
    SetTaskID(ID)
    GetTaskID() ID
    GetOwnerID() ID
    SetOwnerID(ID)
    GenerateFlux(lang FluxLanguageService) (string, error)
    json.Marshaler

    CRUDLogSetter
    SetID(id ID)
    SetOrgID(id ID)
    SetName(name string)
    SetDescription(description string)

    GetID() ID
    GetCRUDLog() CRUDLog
    GetOrgID() ID
    GetName() string
    GetDescription() string
}

Check represents the information required to generate a periodic check task.

type CheckCreate Uses

type CheckCreate struct {
    Check
    Status Status `json:"status"`
}

CheckCreate represent data to create a new Check

type CheckFilter Uses

type CheckFilter struct {
    ID    *ID
    Name  *string
    OrgID *ID
    Org   *string
    UserResourceMappingFilter
}

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

func (CheckFilter) QueryParams Uses

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

QueryParams Converts CheckFilter fields to url query params.

type CheckService Uses

type CheckService interface {
    // FindCheckByID returns a single check by ID.
    FindCheckByID(ctx context.Context, id ID) (Check, error)

    // FindCheck returns the first check that matches filter.
    FindCheck(ctx context.Context, filter CheckFilter) (Check, error)

    // FindChecks returns a list of checks that match filter and the total count of matching checks.
    // Additional options provide pagination & sorting.
    FindChecks(ctx context.Context, filter CheckFilter, opt ...FindOptions) ([]Check, int, error)

    // CreateCheck creates a new check and sets b.ID with the new identifier.
    CreateCheck(ctx context.Context, c CheckCreate, userID ID) error

    // UpdateCheck updates the whole check.
    // Returns the new check state after update.
    UpdateCheck(ctx context.Context, id ID, c CheckCreate) (Check, error)

    // PatchCheck updates a single bucket with changeset.
    // Returns the new check state after update.
    PatchCheck(ctx context.Context, id ID, upd CheckUpdate) (Check, error)

    // DeleteCheck will delete the check by id.
    DeleteCheck(ctx context.Context, id ID) error
}

CheckService represents a service for managing checks.

type CheckUpdate Uses

type CheckUpdate struct {
    Name        *string `json:"name,omitempty"`
    Status      *Status `json:"status,omitempty"`
    Description *string `json:"description,omitempty"`
}

CheckUpdate are properties than can be updated on a check

func (*CheckUpdate) Valid Uses

func (n *CheckUpdate) Valid() error

Valid returns err is the update is invalid.

type CheckViewProperties Uses

type CheckViewProperties struct {
    Type       string           `json:"type"`
    CheckID    string           `json:"checkID"`
    Queries    []DashboardQuery `json:"queries"`
    ViewColors []string         `json:"colors"`
}

CheckViewProperties represents options for a view representing a check

func (CheckViewProperties) GetType Uses

func (v CheckViewProperties) GetType() string

type ChronografError Uses

type ChronografError string

ChronografError is a domain error encountered while processing chronograf requests.

func (ChronografError) Error Uses

func (e ChronografError) Error() string

ChronografError returns the string of an error.

type DBRPMapping Uses

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 Uses

func (m *DBRPMapping) Equal(o *DBRPMapping) bool

Equal checks if the two mappings are identical.

func (DBRPMapping) Validate Uses

func (m DBRPMapping) Validate() error

Validate reports any validation errors for the mapping.

type DBRPMappingFilter Uses

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 Uses

func (f DBRPMappingFilter) String() string

type DBRPMappingFilterV2 Uses

type DBRPMappingFilterV2 struct {
    ID       *ID
    OrgID    *ID
    BucketID *ID

    Database        *string
    RetentionPolicy *string
    Default         *bool
}

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

func (DBRPMappingFilterV2) String Uses

func (f DBRPMappingFilterV2) String() string

type DBRPMappingService Uses

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 DBRPMappingServiceV2 Uses

type DBRPMappingServiceV2 interface {
    // FindBy returns the dbrp mapping for the specified ID.
    // Requires orgID because every resource will be org-scoped.
    FindByID(ctx context.Context, orgID, id ID) (*DBRPMappingV2, error)
    // FindMany returns a list of dbrp mappings that match filter and the total count of matching dbrp mappings.
    FindMany(ctx context.Context, dbrp DBRPMappingFilterV2, opts ...FindOptions) ([]*DBRPMappingV2, int, error)
    // Create creates a new dbrp mapping, if a different mapping exists an error is returned.
    Create(ctx context.Context, dbrp *DBRPMappingV2) error
    // Update a new dbrp mapping
    Update(ctx context.Context, dbrp *DBRPMappingV2) error
    // Delete removes a dbrp mapping.
    // Deleting a mapping that does not exists is not an error.
    // Requires orgID because every resource will be org-scoped.
    Delete(ctx context.Context, orgID, id ID) error
}

DBRPMappingServiceV2 provides CRUD to DBRPMappingV2s.

type DBRPMappingV2 Uses

type DBRPMappingV2 struct {
    ID              ID     `json:"id"`
    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"`
}

DBRPMappingV2 represents a mapping of a database and retention policy to an organization ID and bucket ID.

func (*DBRPMappingV2) Equal Uses

func (m *DBRPMappingV2) Equal(o *DBRPMappingV2) bool

Equal checks if the two mappings are identical.

func (DBRPMappingV2) Validate Uses

func (m DBRPMappingV2) Validate() error

Validate reports any validation errors for the mapping.

type Dashboard Uses

type Dashboard struct {
    ID             ID            `json:"id,omitempty"`
    OrganizationID ID            `json:"orgID,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 Uses

type DashboardFilter struct {
    IDs            []*ID
    OrganizationID *ID
    Organization   *string
}

DashboardFilter is a filter for dashboards.

func (DashboardFilter) QueryParams Uses

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

QueryParams turns a dashboard filter into query params

It implements PagingFilter.

type DashboardMeta Uses

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

DashboardMeta contains meta information about dashboards

type DashboardOperationLogService Uses

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 Uses

type DashboardQuery struct {
    Text          string        `json:"text"`
    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 Uses

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 dashboard.
    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 Uses

type DashboardUpdate struct {
    Name        *string  `json:"name"`
    Description *string  `json:"description"`
    Cells       *[]*Cell `json:"cells"`
}

DashboardUpdate is the patch structure for a dashboard.

func (DashboardUpdate) Apply Uses

func (u DashboardUpdate) Apply(d *Dashboard) error

Apply applies an update to a dashboard.

func (DashboardUpdate) Valid Uses

func (u DashboardUpdate) Valid() *Error

Valid returns an error if the dashboard update is invalid.

type DecimalPlaces Uses

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 DeleteService Uses

type DeleteService interface {
    DeleteBucketRangePredicate(ctx context.Context, orgID, bucketID ID, min, max int64, pred Predicate) error
}

DeleteService will delete a bucket from the range and predict.

type Document Uses

type Document struct {
    ID      ID           `json:"id"`
    Meta    DocumentMeta `json:"meta"`
    Content interface{}  `json:"content,omitempty"` // TODO(desa): maybe this needs to be json.Marshaller & json.Unmarshaler
    Labels  []*Label     `json:"labels,omitempty"`  // read only

    // This is needed for authorization.
    // The service that passes documents around will take care of filling it
    // via request parameters or others, as the kv store will take care of
    // filling it once it returns a document.
    // This is not stored in the kv store neither required in the API.
    Organizations map[ID]UserType `json:"-"`
}

Document is a generic structure for stating data.

type DocumentDecorator Uses

type DocumentDecorator interface {
    IncludeContent() error
    IncludeLabels() error
    IncludeOrganizations() error
}

DocumentDecorator passes information to the DocumentStore about the presentation of the data being retrieved.

type DocumentFindOptions Uses

type DocumentFindOptions func(DocumentIndex, DocumentDecorator) ([]ID, error)

DocumentFindOptions are used to lookup documents. TODO(desa): consider changing this to have a single struct that has both

the decorator and the index on it.

type DocumentIndex Uses

type DocumentIndex interface {
    GetAccessorsDocuments(ownerType string, ownerID ID) ([]ID, error)
    GetDocumentsAccessors(docID ID) ([]ID, error)

    UsersOrgs(userID ID) ([]ID, error)
    // IsOrgAccessor checks to see if the userID provided is allowed to access
    // the orgID privided. If the lookup is done in a writable operation
    // then this method should ensure that the user is an org owner. If the
    // operation is readable, then it should only require that the user is an org
    // member.
    IsOrgAccessor(userID, orgID ID) error

    // TODO(desa): support finding document by label
    FindOrganizationByName(n string) (ID, error)
    FindOrganizationByID(id ID) error
    FindLabelByID(id ID) error
}

DocumentIndex is a structure that is used in DocumentFindOptions to filter out documents based on some criteria.

type DocumentMeta Uses

type DocumentMeta struct {
    Name        string `json:"name"`
    Type        string `json:"type,omitempty"`
    Description string `json:"description,omitempty"`
    Version     string `json:"version,omitempty"`
    CRUDLog
}

DocumentMeta is information that is universal across documents. Ideally data in the meta should be indexed and queryable.

type DocumentService Uses

type DocumentService interface {
    CreateDocumentStore(ctx context.Context, name string) (DocumentStore, error)
    FindDocumentStore(ctx context.Context, name string) (DocumentStore, error)
}

DocumentService is used to create/find instances of document stores.

type DocumentStore Uses

type DocumentStore interface {
    CreateDocument(ctx context.Context, d *Document) error
    FindDocument(ctx context.Context, id ID) (*Document, error)
    UpdateDocument(ctx context.Context, d *Document) error
    DeleteDocument(ctx context.Context, id ID) error

    FindDocuments(ctx context.Context, opts ...DocumentFindOptions) ([]*Document, error)
    DeleteDocuments(ctx context.Context, opts ...DocumentFindOptions) error
}

DocumentStore is used to perform CRUD operations on documents. It follows an options pattern that allows users to perform actions related to documents in a transactional way.

type Duration Uses

type Duration struct {
    time.Duration
}

Duration is based on time.Duration to embed in any struct.

func (Duration) MarshalJSON Uses

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Duration) UnmarshalJSON Uses

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type EmptyViewProperties Uses

type EmptyViewProperties struct{}

EmptyViewProperties is visualization that has no values

func (EmptyViewProperties) GetType Uses

func (v EmptyViewProperties) GetType() string

type Error Uses

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 ErrCorruptID Uses

func ErrCorruptID(err error) *Error

ErrCorruptID means the ID stored in the Store is corrupt.

func ErrFluxParseError Uses

func ErrFluxParseError(err error) *Error

ErrFluxParseError is returned when an error is thrown by Flux.Parse in the task executor

func ErrInternalBucketServiceError Uses

func ErrInternalBucketServiceError(op string, err error) *Error

func ErrInternalOrgServiceError Uses

func ErrInternalOrgServiceError(op string, err error) *Error

func ErrInternalTaskServiceError Uses

func ErrInternalTaskServiceError(err error) *Error

func ErrJsonMarshalError Uses

func ErrJsonMarshalError(err error) *Error

func ErrQueryError Uses

func ErrQueryError(err error) *Error

ErrQueryError is returned when an error is thrown by Query service in the task executor

func ErrResultIteratorError Uses

func ErrResultIteratorError(err error) *Error

ErrResultIteratorError is returned when an error is thrown by exhaustResultIterators in the executor

func ErrRunExecutionError Uses

func ErrRunExecutionError(err error) *Error

func ErrTaskConcurrencyLimitReached Uses

func ErrTaskConcurrencyLimitReached(runsInFront int) *Error

func ErrTaskOptionParse Uses

func ErrTaskOptionParse(err error) *Error

func ErrTaskTimeParse Uses

func ErrTaskTimeParse(err error) *Error

ErrTaskTimeParse an error for time parsing errors

func ErrUnexpectedTaskBucketErr Uses

func ErrUnexpectedTaskBucketErr(err error) *Error

ErrUnexpectedTaskBucketErr a generic error we can use when we rail to retrieve a bucket

func NewError Uses

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

NewError returns an instance of an error.

func (*Error) Error Uses

func (e *Error) Error() string

Error implements the error interface by writing out the recursive messages.

func (*Error) MarshalJSON Uses

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

MarshalJSON recursively marshals the stack of Err.

func (*Error) UnmarshalJSON Uses

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

UnmarshalJSON recursively unmarshals the error stack.

type FindOptions Uses

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

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

func DecodeFindOptions Uses

func DecodeFindOptions(r *http.Request) (*FindOptions, error)

DecodeFindOptions returns a FindOptions decoded from http request.

func (FindOptions) QueryParams Uses

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

QueryParams returns a map containing url query params.

type FluxLanguageService Uses

type FluxLanguageService interface {
    // Parse will take flux source code and produce a package.
    // If there are errors when parsing, the first error is returned.
    // An ast.Package may be returned when a parsing error occurs,
    // but it may be null if parsing didn't even occur.
    Parse(source string) (*ast.Package, error)

    // EvalAST will evaluate and run an AST.
    EvalAST(ctx context.Context, astPkg *ast.Package) ([]interpreter.SideEffect, values.Scope, error)

    // Completer will return a flux completer.
    Completer() complete.Completer
}

FluxLanguageService is a service for interacting with flux code.

type GaugeViewProperties Uses

type GaugeViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    Prefix            string           `json:"prefix"`
    TickPrefix        string           `json:"tickPrefix"`
    Suffix            string           `json:"suffix"`
    TickSuffix        string           `json:"tickSuffix"`
    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 Uses

func (v GaugeViewProperties) GetType() string

type HTTPErrorHandler Uses

type HTTPErrorHandler interface {
    HandleHTTPError(ctx context.Context, err error, w http.ResponseWriter)
}

HTTPErrorHandler is the interface to handle http error.

type HeatmapViewProperties Uses

type HeatmapViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    ViewColors        []string         `json:"colors"`
    BinSize           int32            `json:"binSize"`
    XColumn           string           `json:"xColumn"`
    YColumn           string           `json:"yColumn"`
    XDomain           []float64        `json:"xDomain,omitempty"`
    YDomain           []float64        `json:"yDomain,omitempty"`
    XAxisLabel        string           `json:"xAxisLabel"`
    YAxisLabel        string           `json:"yAxisLabel"`
    XPrefix           string           `json:"xPrefix"`
    XSuffix           string           `json:"xSuffix"`
    YPrefix           string           `json:"yPrefix"`
    YSuffix           string           `json:"ySuffix"`
    Note              string           `json:"note"`
    ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
    TimeFormat        string           `json:"timeFormat"`
}

HeatmapViewProperties represents options for heatmap view in Chronograf

func (HeatmapViewProperties) GetType Uses

func (v HeatmapViewProperties) GetType() string

type HistogramViewProperties Uses

type HistogramViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    ViewColors        []ViewColor      `json:"colors"`
    XColumn           string           `json:"xColumn"`
    FillColumns       []string         `json:"fillColumns"`
    XDomain           []float64        `json:"xDomain,omitempty"`
    XAxisLabel        string           `json:"xAxisLabel"`
    Position          string           `json:"position"`
    BinCount          int              `json:"binCount"`
    Note              string           `json:"note"`
    ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
}

HistogramViewProperties represents options for histogram view in Chronograf

func (HistogramViewProperties) GetType Uses

func (v HistogramViewProperties) GetType() string

type ID Uses

type ID uint64

ID is a unique identifier.

Its zero value is not a valid ID.

func IDFromString Uses

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 IncludeContent Uses

func IncludeContent(_ DocumentIndex, dd DocumentDecorator) ([]ID, error)

IncludeContent signals to the DocumentStore that the content of the document should be included.

func IncludeLabels Uses

func IncludeLabels(_ DocumentIndex, dd DocumentDecorator) ([]ID, error)

IncludeLabels signals to the DocumentStore that the documents labels should be included.

func IncludeOrganizations Uses

func IncludeOrganizations(_ DocumentIndex, dd DocumentDecorator) ([]ID, error)

IncludeOwner signals to the DocumentStore that the owner should be included.

func InvalidID Uses

func InvalidID() ID

InvalidID returns a zero ID.

func (*ID) Decode Uses

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 Uses

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

DecodeFromString parses s as a hex-encoded string.

func (ID) Encode Uses

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 Uses

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) MarshalText Uses

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

MarshalText encodes i as text. Providing this method is a fallback for json.Marshal, with the added benefit that IDs encoded as map keys will be the expected string encoding, rather than the effective fmt.Sprintf("%d", i) that json.Marshal uses by default for integer types.

func (ID) String Uses

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) UnmarshalText Uses

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

UnmarshalText decodes i from a byte slice. Providing this method is also a fallback for json.Unmarshal, also relevant when IDs are used as map keys.

func (ID) Valid Uses

func (i ID) Valid() bool

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

type IDGenerator Uses

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

IDGenerator represents a generator for IDs.

type KVBackupService Uses

type KVBackupService interface {
    // Backup creates a live backup copy of the metadata database.
    Backup(ctx context.Context, w io.Writer) error
}

KVBackupService represents the meta data backup functions of InfluxDB.

type KeyValueLog Uses

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)
}

KeyValueLog 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.

type Label Uses

type Label struct {
    ID         ID                `json:"id,omitempty"`
    OrgID      ID                `json:"orgID,omitempty"`
    Name       string            `json:"name"`
    Properties map[string]string `json:"properties,omitempty"`
}

Label is a tag set on a resource, typically used for filtering on a UI.

func (*Label) Validate Uses

func (l *Label) Validate() error

Validate returns an error if the label is invalid.

type LabelFilter Uses

type LabelFilter struct {
    Name  string
    OrgID *ID
}

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

type LabelMapping Uses

type LabelMapping struct {
    LabelID      ID  `json:"labelID"`
    ResourceID   ID  `json:"resourceID,omitempty"`
    ResourceType `json:"resourceType"`
}

LabelMapping is used to map resource to its labels. It should not be shared directly over the HTTP API.

func (*LabelMapping) Validate Uses

func (l *LabelMapping) Validate() error

Validate returns an error if the mapping is invalid.

type LabelMappingFilter Uses

type LabelMappingFilter struct {
    ResourceID ID
    ResourceType
}

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

type LabelService Uses

type LabelService interface {
    // FindLabelByID a single label by ID.
    FindLabelByID(ctx context.Context, id ID) (*Label, error)

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

    // FindResourceLabels returns a list of labels that belong to a resource
    FindResourceLabels(ctx context.Context, filter LabelMappingFilter) ([]*Label, error)

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

    // CreateLabelMapping maps a resource to an existing label
    CreateLabelMapping(ctx context.Context, m *LabelMapping) error

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

    // DeleteLabel deletes a label
    DeleteLabel(ctx context.Context, id ID) error

    // DeleteLabelMapping deletes a label mapping
    DeleteLabelMapping(ctx context.Context, m *LabelMapping) error
}

LabelService represents a service for managing resource labels

type LabelUpdate Uses

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

LabelUpdate represents a changeset for a label. Only the properties specified are updated.

type Lease Uses

type Lease interface {
    // TTL returns the duration of time remaining before the lease expires.
    TTL(context.Context) (time.Duration, error)

    // Release terminates ownership of the semaphore by revoking the lease.
    Release(context.Context) error

    // KeepAlive extends the lease back to the original TTL.
    KeepAlive(context.Context) error
}

A Lease represents ownership over a semaphore. It gives the owner the ability to extend ownership over the semaphore or release ownership of the semaphore.

type Legend Uses

type Legend struct {
    Type        string `json:"type,omitempty"`
    Orientation string `json:"orientation,omitempty"`
}

Legend represents the encoding of data into a legend

type Limit Uses

type Limit struct {
    Rate int `json:"limit,omitempty"`
    // every seconds.
    Every int `json:"limitEvery,omitempty"`
}

Limit don't notify me more than <limit> times every <limitEvery> seconds. If set, limit cannot be empty.

type LinePlusSingleStatProperties Uses

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"`
    XColumn           string           `json:"xColumn"`
    YColumn           string           `json:"yColumn"`
    ShadeBelow        bool             `json:"shadeBelow"`
    Position          string           `json:"position"`
    TimeFormat        string           `json:"timeFormat"`
    HoverDimension    string           `json:"hoverDimension"`
}

LinePlusSingleStatProperties represents options for line plus single stat view in Chronograf

func (LinePlusSingleStatProperties) GetType Uses

func (v LinePlusSingleStatProperties) GetType() string

type Log Uses

type Log struct {
    RunID   ID     `json:"runID,omitempty"`
    Time    string `json:"time"`
    Message string `json:"message"`
}

Log represents a link to a log resource

func (Log) String Uses

func (l Log) String() string

type LogColumnSetting Uses

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 Uses

type LogFilter struct {
    // Task ID is required.
    Task ID

    // The optional Run ID limits logs to a single run.
    Run *ID
}

LogFilter represents a set of filters that restrict the returned log results.

type LogViewProperties Uses

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

LogViewProperties represents options for log viewer in Chronograf.

func (LogViewProperties) GetType Uses

func (v LogViewProperties) GetType() string

type LogViewerColumn Uses

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 Uses

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

LookupService provides field lookup for the resource and ID.

type MappingType Uses

type MappingType uint8

func (MappingType) MarshalJSON Uses

func (mt MappingType) MarshalJSON() ([]byte, error)

func (MappingType) String Uses

func (mt MappingType) String() string

func (*MappingType) UnmarshalJSON Uses

func (mt *MappingType) UnmarshalJSON(b []byte) error

func (MappingType) Valid Uses

func (mt MappingType) Valid() error

type MarkdownViewProperties Uses

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

func (MarkdownViewProperties) GetType Uses

func (v MarkdownViewProperties) GetType() string

type MosaicViewProperties Uses

type MosaicViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    ViewColors        []string         `json:"colors"`
    FillColumns       []string         `json:"fillColumns"`
    XColumn           string           `json:"xColumn"`
    YSeriesColumns    []string         `json:"ySeriesColumns"`
    XDomain           []float64        `json:"xDomain,omitempty"`
    YDomain           []float64        `json:"yDomain,omitempty"`
    XAxisLabel        string           `json:"xAxisLabel"`
    YAxisLabel        string           `json:"yAxisLabel"`
    XPrefix           string           `json:"xPrefix"`
    XSuffix           string           `json:"xSuffix"`
    YPrefix           string           `json:"yPrefix"`
    YSuffix           string           `json:"ySuffix"`
    Note              string           `json:"note"`
    ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
    TimeFormat        string           `json:"timeFormat"`
}

MosaicViewProperties represents options for mosaic view in Chronograf

func (MosaicViewProperties) GetType Uses

func (v MosaicViewProperties) GetType() string

type NotificationEndpoint Uses

type NotificationEndpoint interface {
    Valid() error
    Type() string
    json.Marshaler
    CRUDLogSetter
    SetID(id ID)
    SetOrgID(id ID)
    SetName(name string)
    SetDescription(description string)
    SetStatus(status Status)

    GetID() ID
    GetCRUDLog() CRUDLog
    GetOrgID() ID
    GetName() string
    GetDescription() string
    GetStatus() Status
    // SecretFields return available secret fields.
    SecretFields() []SecretField
    // BackfillSecretKeys fill back fill the secret field key during the unmarshalling
    // if value of that secret field is not nil.
    BackfillSecretKeys()
}

NotificationEndpoint is the configuration describing how to call a 3rd party service. E.g. Slack, Pagerduty

type NotificationEndpointFilter Uses

type NotificationEndpointFilter struct {
    ID    *ID
    OrgID *ID
    Org   *string
    UserResourceMappingFilter
}

NotificationEndpointFilter represents a set of filter that restrict the returned notification endpoints.

func (NotificationEndpointFilter) QueryParams Uses

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

QueryParams Converts NotificationEndpointFilter fields to url query params.

type NotificationEndpointService Uses

type NotificationEndpointService interface {
    // UserResourceMappingService must be part of all NotificationEndpointStore service,
    // for create, delete.
    UserResourceMappingService
    // OrganizationService is needed for search filter
    OrganizationService

    // FindNotificationEndpointByID returns a single notification endpoint by ID.
    FindNotificationEndpointByID(ctx context.Context, id ID) (NotificationEndpoint, error)

    // FindNotificationEndpoints returns a list of notification endpoints that match filter and the total count of matching notification endpoints.
    // Additional options provide pagination & sorting.
    FindNotificationEndpoints(ctx context.Context, filter NotificationEndpointFilter, opt ...FindOptions) ([]NotificationEndpoint, int, error)

    // CreateNotificationEndpoint creates a new notification endpoint and sets b.ID with the new identifier.
    CreateNotificationEndpoint(ctx context.Context, ne NotificationEndpoint, userID ID) error

    // UpdateNotificationEndpoint updates a single notification endpoint.
    // Returns the new notification endpoint after update.
    UpdateNotificationEndpoint(ctx context.Context, id ID, nr NotificationEndpoint, userID ID) (NotificationEndpoint, error)

    // PatchNotificationEndpoint updates a single  notification endpoint with changeset.
    // Returns the new notification endpoint state after update.
    PatchNotificationEndpoint(ctx context.Context, id ID, upd NotificationEndpointUpdate) (NotificationEndpoint, error)

    // DeleteNotificationEndpoint removes a notification endpoint by ID, returns secret fields, orgID for further deletion.
    DeleteNotificationEndpoint(ctx context.Context, id ID) (flds []SecretField, orgID ID, err error)
}

NotificationEndpointService represents a service for managing notification endpoints.

type NotificationEndpointUpdate Uses

type NotificationEndpointUpdate struct {
    Name        *string `json:"name,omitempty"`
    Description *string `json:"description,omitempty"`
    Status      *Status `json:"status,omitempty"`
}

NotificationEndpointUpdate is the set of upgrade fields for patch request.

func (*NotificationEndpointUpdate) Valid Uses

func (n *NotificationEndpointUpdate) Valid() error

Valid will verify if the NotificationEndpointUpdate is valid.

type NotificationRule Uses

type NotificationRule interface {
    Valid() error
    Type() string
    json.Marshaler
    CRUDLogSetter
    SetID(id ID)
    SetOrgID(id ID)
    SetName(name string)
    SetDescription(description string)
    GetID() ID
    GetCRUDLog() CRUDLog
    GetOrgID() ID
    GetName() string
    GetDescription() string
    SetOwnerID(id ID)
    ClearPrivateData()
    GetOwnerID() ID
    SetTaskID(id ID)
    GetTaskID() ID
    GetEndpointID() ID
    GetLimit() *Limit
    GenerateFlux(NotificationEndpoint) (string, error)
    MatchesTags(tags []Tag) bool
}

NotificationRule is a *Query* of a *Status Bucket* that returns the *Status*. When warranted by the rules, sends a *Message* to a 3rd Party using the *Notification Endpoint* and stores a receipt in the *Notifications Bucket*.

type NotificationRuleCreate Uses

type NotificationRuleCreate struct {
    NotificationRule
    Status Status `json:"status"`
}

NotificationRuleCreate is the struct providing data to create a Notification Rule.

type NotificationRuleFilter Uses

type NotificationRuleFilter struct {
    OrgID        *ID
    Organization *string
    Tags         []Tag
    UserResourceMappingFilter
}

NotificationRuleFilter represents a set of filter that restrict the returned notification rules.

func (NotificationRuleFilter) QueryParams Uses

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

QueryParams Converts NotificationRuleFilter fields to url query params.

type NotificationRuleStore Uses

type NotificationRuleStore interface {
    // FindNotificationRuleByID returns a single notification rule by ID.
    FindNotificationRuleByID(ctx context.Context, id ID) (NotificationRule, error)

    // FindNotificationRules returns a list of notification rules that match filter and the total count of matching notification rules.
    // Additional options provide pagination & sorting.
    FindNotificationRules(ctx context.Context, filter NotificationRuleFilter, opt ...FindOptions) ([]NotificationRule, int, error)

    // CreateNotificationRule creates a new notification rule and sets b.ID with the new identifier.
    CreateNotificationRule(ctx context.Context, nr NotificationRuleCreate, userID ID) error

    // UpdateNotificationRuleUpdateNotificationRule updates a single notification rule.
    // Returns the new notification rule after update.
    UpdateNotificationRule(ctx context.Context, id ID, nr NotificationRuleCreate, userID ID) (NotificationRule, error)

    // PatchNotificationRule updates a single  notification rule with changeset.
    // Returns the new notification rule state after update.
    PatchNotificationRule(ctx context.Context, id ID, upd NotificationRuleUpdate) (NotificationRule, error)

    // DeleteNotificationRule removes a notification rule by ID.
    DeleteNotificationRule(ctx context.Context, id ID) error
}

NotificationRuleStore represents a service for managing notification rule.

type NotificationRuleUpdate Uses

type NotificationRuleUpdate struct {
    Name        *string `json:"name,omitempty"`
    Description *string `json:"description,omitempty"`
    Status      *Status `json:"status,omitempty"`
}

NotificationRuleUpdate is the set of upgrade fields for patch request.

func (*NotificationRuleUpdate) Valid Uses

func (n *NotificationRuleUpdate) Valid() error

Valid will verify if the NotificationRuleUpdate is valid.

type OnboardingRequest Uses

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

OnboardingRequest is the request to setup defaults.

func (*OnboardingRequest) Valid Uses

func (r *OnboardingRequest) Valid() error

type OnboardingResults Uses

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 Uses

type OnboardingService interface {
    // IsOnboarding determine if onboarding request is allowed.
    IsOnboarding(ctx context.Context) (bool, error)

    // OnboardInitialUser OnboardingResults.
    OnboardInitialUser(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)

    // OnboardUser creates a new user/org/buckets
    OnboardUser(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)
}

OnboardingService represents a service for the first run.

type OperationLogEntry Uses

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 Operator Uses

type Operator int

Operator is an Enum value of operators.

const (
    Equal Operator = iota
    NotEqual
    RegexEqual
    NotRegexEqual
)

operators

func ToOperator Uses

func ToOperator(s string) (Operator, bool)

ToOperator converts a string into its equivalent Operator.

func (Operator) MarshalJSON Uses

func (op Operator) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshal interface.

func (Operator) String Uses

func (op Operator) String() string

String returns the string value of the operator.

func (*Operator) UnmarshalJSON Uses

func (op *Operator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

func (Operator) Valid Uses

func (op Operator) Valid() error

Valid returns invalid error if the operator is invalid.

type Organization Uses

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

Organization is an organization. 🎉

type OrganizationFilter Uses

type OrganizationFilter struct {
    Name   *string
    ID     *ID
    UserID *ID
}

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

type OrganizationOperationLogService Uses

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 Uses

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 Uses

type OrganizationUpdate struct {
    Name        *string
    Description *string `json:"description,omitempty"`
}

OrganizationUpdate represents updates to a organization. Only fields which are set are updated.

type PagingFilter Uses

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.

func NewPagingLinks(basePath string, opts FindOptions, f PagingFilter, num int) *PagingLinks

NewPagingLinks returns a PagingLinks. num is the number of returned results.

type PasswordsService Uses

type PasswordsService interface {
    // SetPassword overrides the password of a known user.
    SetPassword(ctx context.Context, userID ID, password string) error
    // ComparePassword checks if the password matches the password recorded.
    // Passwords that do not match return errors.
    ComparePassword(ctx context.Context, userID ID, password string) error
    // CompareAndSetPassword checks the password and if they match
    // updates to the new password.
    CompareAndSetPassword(ctx context.Context, userID ID, old, new string) error
}

PasswordsService is the service for managing basic auth passwords.

type Permission Uses

type Permission struct {
    Action   Action   `json:"action"`
    Resource Resource `json:"resource"`
}

Permission defines an action and a resource.

func MePermissions Uses

func MePermissions(userID ID) []Permission

MePermissions is the permission to read/write myself.

func MemberBucketPermission Uses

func MemberBucketPermission(bucketID ID) Permission

MemberPermissions are the default permissions for those who can see a resource.

func MemberPermissions Uses

func MemberPermissions(orgID ID) []Permission

MemberPermissions are the default permissions for those who can see a resource.

func NewGlobalPermission Uses

func NewGlobalPermission(a Action, rt ResourceType) (*Permission, error)

NewGlobalPermission constructs a global permission capable of accessing any resource of type rt.

func NewPermission Uses

func NewPermission(a Action, rt ResourceType, orgID ID) (*Permission, error)

NewPermission returns a permission with provided arguments.

func NewPermissionAtID Uses

func NewPermissionAtID(id ID, a Action, rt ResourceType, orgID ID) (*Permission, error)

NewPermissionAtID creates a permission with the provided arguments.

func NewResourcePermission Uses

func NewResourcePermission(a Action, rt ResourceType, rid ID) (*Permission, error)

NewResourcePermission returns a permission with provided arguments.

func OperPermissions Uses

func OperPermissions() []Permission

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

func OwnerPermissions Uses

func OwnerPermissions(orgID ID) []Permission

OwnerPermissions are the default permissions for those who own a resource.

func ReadAllPermissions Uses

func ReadAllPermissions() []Permission

ReadAllPermissions represents permission to read all data and metadata. Like OperPermissions, but allows read-only users.

func (Permission) Matches Uses

func (p Permission) Matches(perm Permission) bool

Matches returns whether or not one permission matches the other.

func (Permission) String Uses

func (p Permission) String() string

func (*Permission) Valid Uses

func (p *Permission) Valid() error

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

type PermissionSet Uses

type PermissionSet []Permission

func (PermissionSet) Allowed Uses

func (ps PermissionSet) Allowed(p Permission) bool

type Predicate Uses

type Predicate interface {
    Clone() Predicate
    Matches(key []byte) bool
    Marshal() ([]byte, error)
}

Predicate is something that can match on a series key.

type RealTimeGenerator Uses

type RealTimeGenerator struct{}

RealTimeGenerator will generate the real time.

func (RealTimeGenerator) Now Uses

func (g RealTimeGenerator) Now() time.Time

Now returns the current time.

type RenamableField Uses

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 RequestStillQueuedError Uses

type RequestStillQueuedError struct {
    // Unix timestamps matching existing request's start and end.
    Start, End int64
}

RequestStillQueuedError is returned when attempting to retry a run which has not yet completed.

func ParseRequestStillQueuedError Uses

func ParseRequestStillQueuedError(msg string) *RequestStillQueuedError

ParseRequestStillQueuedError attempts to parse a RequestStillQueuedError from msg. If msg is formatted correctly, the resultant error is returned; otherwise it returns nil.

func (RequestStillQueuedError) Error Uses

func (e RequestStillQueuedError) Error() string

type Resource Uses

type Resource struct {
    Type  ResourceType `json:"type"`
    ID    *ID          `json:"id,omitempty"`
    OrgID *ID          `json:"orgID,omitempty"`
}

Resource is an authorizable resource.

func (Resource) String Uses

func (r Resource) String() string

String stringifies a resource

func (Resource) Valid Uses

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

Valid checks if the resource type is a member of the ResourceType enum.

type ResourceType Uses

type ResourceType string

ResourceType is an enum defining all resource types that have a permission model in platform

func (ResourceType) Valid Uses

func (t ResourceType) Valid() (err error)

Valid checks if the resource type is a member of the ResourceType enum.

type Run Uses

type Run struct {
    ID           ID        `json:"id,omitempty"`
    TaskID       ID        `json:"taskID"`
    Status       string    `json:"status"`
    ScheduledFor time.Time `json:"scheduledFor"`          // ScheduledFor is the Now time used in the task's query
    RunAt        time.Time `json:"runAt"`                 // RunAt is the time the task is scheduled to be run, which is ScheduledFor + Offset
    StartedAt    time.Time `json:"startedAt,omitempty"`   // StartedAt is the time the executor begins running the task
    FinishedAt   time.Time `json:"finishedAt,omitempty"`  // FinishedAt is the time the executor finishes running the task
    RequestedAt  time.Time `json:"requestedAt,omitempty"` // RequestedAt is the time the coordinator told the scheduler to schedule the task
    Log          []Log     `json:"log,omitempty"`
}

Run is a record createId when a run of a task is scheduled.

type RunFilter Uses

type RunFilter struct {
    // Task ID is required for listing runs.
    Task ID

    After      *ID
    Limit      int
    AfterTime  string
    BeforeTime string
}

RunFilter represents a set of filters that restrict the returned results

type RunStatus Uses

type RunStatus int
const (
    RunStarted RunStatus = iota
    RunSuccess
    RunFail
    RunCanceled
    RunScheduled
)

func (RunStatus) String Uses

func (r RunStatus) String() string

type ScatterViewProperties Uses

type ScatterViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    ViewColors        []string         `json:"colors"`
    FillColumns       []string         `json:"fillColumns"`
    SymbolColumns     []string         `json:"symbolColumns"`
    XColumn           string           `json:"xColumn"`
    YColumn           string           `json:"yColumn"`
    XDomain           []float64        `json:"xDomain,omitempty"`
    YDomain           []float64        `json:"yDomain,omitempty"`
    XAxisLabel        string           `json:"xAxisLabel"`
    YAxisLabel        string           `json:"yAxisLabel"`
    XPrefix           string           `json:"xPrefix"`
    XSuffix           string           `json:"xSuffix"`
    YPrefix           string           `json:"yPrefix"`
    YSuffix           string           `json:"ySuffix"`
    Note              string           `json:"note"`
    ShowNoteWhenEmpty bool             `json:"showNoteWhenEmpty"`
    TimeFormat        string           `json:"timeFormat"`
}

ScatterViewProperties represents options for scatter view in Chronograf

func (ScatterViewProperties) GetType Uses

func (v ScatterViewProperties) GetType() string

type ScraperTarget Uses

type ScraperTarget struct {
    ID       ID          `json:"id,omitempty"`
    Name     string      `json:"name"`
    Type     ScraperType `json:"type"`
    URL      string      `json:"url"`
    OrgID    ID          `json:"orgID,omitempty"`
    BucketID ID          `json:"bucketID,omitempty"`
}

ScraperTarget is a target to scrape

type ScraperTargetFilter Uses

type ScraperTargetFilter struct {
    IDs   map[ID]bool `json:"ids"`
    Name  *string     `json:"name"`
    OrgID *ID         `json:"orgID"`
    Org   *string     `json:"org"`
}

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

type ScraperTargetStoreService Uses

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

ScraperTargetStoreService defines the crud service for ScraperTarget.

type ScraperType Uses

type ScraperType string

ScraperType defines the scraper methods.

type SecretField Uses

type SecretField struct {
    Key   string  `json:"key"`
    Value *string `json:"value,omitempty"`
}

SecretField contains a key string, and value pointer.

func (SecretField) MarshalJSON Uses

func (s SecretField) MarshalJSON() ([]byte, error)

MarshalJSON implement the json marshaler interface.

func (SecretField) String Uses

func (s SecretField) String() string

String returns the key of the secret.

func (*SecretField) UnmarshalJSON Uses

func (s *SecretField) UnmarshalJSON(b []byte) error

UnmarshalJSON implement the json unmarshaler interface.

type SecretService Uses

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 Semaphore Uses

type Semaphore interface {
    // TryAcquire attempts to acquire ownership of the semaphore. TryAcquire
    // must not block. Failure to get ownership of the semaphore should be
    // signalled to the caller via the return of the ErrNoAcquire error.
    TryAcquire(ctx context.Context, ttl time.Duration) (Lease, error)
}

A Semaphore provides an API for requesting ownership of an expirable semaphore.

Acquired semaphores have an expiration. If they're not released or kept alive during this period then they will expire and ownership of the semaphore will be lost.

TODO(edd): add AcquireTTL when needed. It should block.

var NopSemaphore Semaphore = nopSemaphore{}

NopSemaphore is a Semaphore that always hands out leases.

type Session Uses

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) EphemeralAuth Uses

func (s *Session) EphemeralAuth(orgID ID) *Authorization

EphemeralAuth generates an Authorization that is not stored but at the user's max privs.

func (*Session) Expired Uses

func (s *Session) Expired() error

Expired returns an error if the session is expired.

func (*Session) GetUserID Uses

func (s *Session) GetUserID() ID

GetUserID returns the user id.

func (*Session) Identifier Uses

func (s *Session) Identifier() ID

Identifier returns the sessions ID and is used for auditing.

func (*Session) Kind Uses

func (s *Session) Kind() string

Kind returns session and is used for auditing.

func (*Session) PermissionSet Uses

func (s *Session) PermissionSet() (PermissionSet, error)

PermissionSet returns the set of permissions associated with the session.

type SessionService Uses

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)
    // TODO: update RenewSession to take a ID instead of a session.
    // By taking a session object it could be confused to update more things about the session
    RenewSession(ctx context.Context, session *Session, newExpiration time.Time) error
}

SessionService represents a service for managing user sessions.

type SingleStatViewProperties Uses

type SingleStatViewProperties struct {
    Type              string           `json:"type"`
    Queries           []DashboardQuery `json:"queries"`
    Prefix            string           `json:"prefix"`
    TickPrefix        string           `json:"tickPrefix"`
    Suffix            string           `json:"suffix"`
    TickSuffix        string           `json:"tickSuffix"`
    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 Uses

func (v SingleStatViewProperties) GetType() string

type Source Uses

type Source struct {
    ID                 ID         `json:"id,omitempty"`                 // ID is the unique ID of the source
    OrganizationID     ID         `json:"orgID"`                        // 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 Uses

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 Uses

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

SourceQuery is a query for a source.

type SourceService Uses

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 Uses

type SourceType string

SourceType is a string for types of sources.

type SourceUpdate Uses

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 Uses

func (u SourceUpdate) Apply(s *Source) error

Apply applies an update to a source.

type Status Uses

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) Ptr Uses

func (s Status) Ptr() *Status

Ptr returns the pointer of that status.

func (Status) Valid Uses

func (s Status) Valid() error

Valid determines if a Status value matches the enum.

type TableOptions Uses

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 Uses

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 Uses

func (v TableViewProperties) GetType() string

type Tag Uses

type Tag struct {
    Key   string `json:"key"`
    Value string `json:"value"`
}

Tag is a tag key-value pair.

func NewTag Uses

func NewTag(s string) (Tag, error)

NewTag generates a tag pair from a string in the format key:value.

func (*Tag) QueryParam Uses

func (t *Tag) QueryParam() string

QueryParam converts a Tag to a string query parameter

func (Tag) Valid Uses

func (t Tag) Valid() error

Valid returns an error if the tagpair is missing fields

type TagRule Uses

type TagRule struct {
    Tag
    Operator Operator `json:"operator"`
}

TagRule is the struct of tag rule.

func (TagRule) Valid Uses

func (tr TagRule) Valid() error

Valid returns error for invalid operators.

type Task Uses

type Task struct {
    ID              ID                     `json:"id"`
    Type            string                 `json:"type,omitempty"`
    OrganizationID  ID                     `json:"orgID"`
    Organization    string                 `json:"org"`
    OwnerID         ID                     `json:"ownerID"`
    Name            string                 `json:"name"`
    Description     string                 `json:"description,omitempty"`
    Status          string                 `json:"status"`
    Flux            string                 `json:"flux"`
    Every           string                 `json:"every,omitempty"`
    Cron            string                 `json:"cron,omitempty"`
    Offset          time.Duration          `json:"offset,omitempty"`
    LatestCompleted time.Time              `json:"latestCompleted,omitempty"`
    LatestScheduled time.Time              `json:"latestScheduled,omitempty"`
    LatestSuccess   time.Time              `json:"latestSuccess,omitempty"`
    LatestFailure   time.Time              `json:"latestFailure,omitempty"`
    LastRunStatus   string                 `json:"lastRunStatus,omitempty"`
    LastRunError    string                 `json:"lastRunError,omitempty"`
    CreatedAt       time.Time              `json:"createdAt,omitempty"`
    UpdatedAt       time.Time              `json:"updatedAt,omitempty"`
    Metadata        map[string]interface{} `json:"metadata,omitempty"`
}

Task is a task. 🎊

func (*Task) EffectiveCron Uses

func (t *Task) EffectiveCron() string

EffectiveCron returns the effective cron string of the options. If the cron option was specified, it is returned. If the every option was specified, it is converted into a cron string using "@every". Otherwise, the empty string is returned. The value of the offset option is not considered.

type TaskCreate Uses

type TaskCreate struct {
    Type           string                 `json:"type,omitempty"`
    Flux           string                 `json:"flux"`
    Description    string                 `json:"description,omitempty"`
    Status         string                 `json:"status,omitempty"`
    OrganizationID ID                     `json:"orgID,omitempty"`
    Organization   string                 `json:"org,omitempty"`
    OwnerID        ID                     `json:"-"`
    Metadata       map[string]interface{} `json:"-"` // not to be set through a web request but rather used by a http service using tasks backend.
}

TaskCreate is the set of values to create a task.

func (TaskCreate) Validate Uses

func (t TaskCreate) Validate() error

type TaskFilter Uses

type TaskFilter struct {
    Type           *string
    Name           *string
    After          *ID
    OrganizationID *ID
    Organization   string
    User           *ID
    Limit          int
    Status         *string
}

TaskFilter represents a set of filters that restrict the returned results

func (TaskFilter) QueryParams Uses

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

QueryParams Converts TaskFilter fields to url query params.

type TaskService Uses

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.
    // The owner of the task is inferred from the authorizer associated with ctx.
    CreateTask(ctx context.Context, t TaskCreate) (*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 TaskStatus Uses

type TaskStatus string
const (
    TaskActive   TaskStatus = "active"
    TaskInactive TaskStatus = "inactive"

    DefaultTaskStatus TaskStatus = TaskActive
)

type TaskUpdate Uses

type TaskUpdate struct {
    Flux        *string `json:"flux,omitempty"`
    Status      *string `json:"status,omitempty"`
    Description *string `json:"description,omitempty"`

    // LatestCompleted us to set latest completed on startup to skip task catchup
    LatestCompleted *time.Time             `json:"-"`
    LatestScheduled *time.Time             `json:"-"`
    LatestSuccess   *time.Time             `json:"-"`
    LatestFailure   *time.Time             `json:"-"`
    LastRunStatus   *string                `json:"-"`
    LastRunError    *string                `json:"-"`
    Metadata        map[string]interface{} `json:"-"` // not to be set through a web request but rather used by a http service using tasks backend.

    // Options gets unmarshalled from json as if it was flat, with the same level as Flux and Status.
    Options options.Options // when we unmarshal this gets unmarshalled from flat key-values
}

TaskUpdate represents updates to a task. Options updates override any options set in the Flux field.

func (*TaskUpdate) MarshalJSON Uses

func (t *TaskUpdate) MarshalJSON() ([]byte, error)

func (*TaskUpdate) UnmarshalJSON Uses

func (t *TaskUpdate) UnmarshalJSON(data []byte) error

func (*TaskUpdate) UpdateFlux Uses

func (t *TaskUpdate) UpdateFlux(ctx context.Context, parser FluxLanguageService, oldFlux string) error

UpdateFlux updates the TaskUpdate to go from updating options to updating a flux string, that now has those updated options in it. It zeros the options in the TaskUpdate.

func (*TaskUpdate) Validate Uses

func (t *TaskUpdate) Validate() error

type TelegrafConfig Uses

type TelegrafConfig struct {
    ID          ID                     `json:"id,omitempty"`          // ID of this config object.
    OrgID       ID                     `json:"orgID,omitempty"`       // OrgID is the id of the owning organization.
    Name        string                 `json:"name,omitempty"`        // Name of this config object.
    Description string                 `json:"description,omitempty"` // Decription of this config object.
    Config      string                 `json:"config,omitempty"`      // ConfigTOML contains the raw toml config.
    Metadata    map[string]interface{} `json:"metadata,omitempty"`    // Metadata for the config.
}

TelegrafConfig stores telegraf config for one telegraf instance.

func (*TelegrafConfig) CountPlugins Uses

func (tc *TelegrafConfig) CountPlugins() map[string]float64

CountPlugins returns a map of the number of times each plugin is used.

func (*TelegrafConfig) UnmarshalJSON Uses

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

UnmarshalJSON implement the json.Unmarshaler interface. Gets called when reading from the kv db. mostly legacy so loading old/stored configs still work. May not remove for a while. Primarily will get hit when user views/downloads config.

type TelegrafConfigFilter Uses

type TelegrafConfigFilter struct {
    OrgID        *ID
    Organization *string
    UserResourceMappingFilter
}

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

type TelegrafConfigStore Uses

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)

    // 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 TenantService Uses

type TenantService interface {
    UserService
    PasswordsService
    UserResourceMappingService
    OrganizationService
    BucketService
}

TenantService is a service that exposes the functionality of the embedded services.

type TimeGenerator Uses

type TimeGenerator interface {
    // Now creates the generated time.
    Now() time.Time
}

TimeGenerator represents a generator for now.

type Timespan Uses

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

Timespan represents a range of time.

type TokenGenerator Uses

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

TokenGenerator represents a generator for API tokens.

type Usage Uses

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 Uses

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

UsageFilter is used to filter usage.

type UsageMetric Uses

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 Uses

type UsageService interface {
    GetUsage(ctx context.Context, filter UsageFilter) (map[UsageMetric]*Usage, error)
}

UsageService is a service for accessing usage statistics.

type User Uses

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

User is a user. 🎉

func (*User) Valid Uses

func (u *User) Valid() error

Valid validates user

type UserFilter Uses

type UserFilter struct {
    ID   *ID
    Name *string
}

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

type UserOperationLogService Uses

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 Uses

type UserResourceMapping struct {
    UserID       ID           `json:"userID"`
    UserType     UserType     `json:"userType"`
    MappingType  MappingType  `json:"mappingType"`
    ResourceType ResourceType `json:"resourceType"`
    ResourceID   ID           `json:"resourceID"`
}

UserResourceMapping represents a mapping of a resource to its user.

func (*UserResourceMapping) ToPermissions Uses

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

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

func (UserResourceMapping) Validate Uses

func (m UserResourceMapping) Validate() error

Validate reports any validation errors for the mapping.

type UserResourceMappingFilter Uses

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

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

type UserResourceMappingService Uses

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, userID ID) error
}

UserResourceMappingService maps the relationships between users and resources.

type UserService Uses

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

    // FindPermissionForUser
    FindPermissionForUser(ctx context.Context, UserID ID) (PermissionSet, error)
}

UserService represents a service for managing user data.

type UserStatus Uses

type UserStatus string

UserStatus indicates whether a user is active or inactive

func (*UserStatus) Valid Uses

func (u *UserStatus) Valid() error

Valid validates user status

type UserType Uses

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 Uses

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

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

type UserUpdate Uses

type UserUpdate struct {
    Name   *string `json:"name"`
    Status *Status `json:"status"`
}

UserUpdate represents updates to a user. Only fields which are set are updated.

func (UserUpdate) Valid Uses

func (uu UserUpdate) Valid() error

Valid validates UserUpdate

type V1SourceFields Uses

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 Variable Uses

type Variable struct {
    ID             ID                 `json:"id,omitempty"`
    OrganizationID ID                 `json:"orgID,omitempty"`
    Name           string             `json:"name"`
    Description    string             `json:"description"`
    Selected       []string           `json:"selected"`
    Arguments      *VariableArguments `json:"arguments"`
    CRUDLog
}

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

func (*Variable) Valid Uses

func (m *Variable) Valid() error

Valid returns an error if a Variable contains invalid data

type VariableArguments Uses

type VariableArguments struct {
    Type   string      `json:"type"`   // "constant", "map", or "query"
    Values interface{} `json:"values"` // either VariableQueryValues, VariableConstantValues, VariableMapValues
}

A VariableArguments contains arguments used when expanding a Variable

func (*VariableArguments) UnmarshalJSON Uses

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

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

type VariableConstantValues Uses

type VariableConstantValues []string

VariableConstantValues are the data for expanding a constants-based Variable

type VariableFilter Uses

type VariableFilter struct {
    ID             *ID
    OrganizationID *ID
    Organization   *string
}

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

func (VariableFilter) QueryParams Uses

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

QueryParams implements PagingFilter.

It converts VariableFilter fields to url query params.

type VariableMapValues Uses

type VariableMapValues map[string]string

VariableMapValues are the data for expanding a map-based Variable

type VariableQueryValues Uses

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

VariableQueryValues contains a query used when expanding a query-based Variable

type VariableService Uses

type VariableService interface {
    // FindVariableByID finds a single variable from the store by its ID
    FindVariableByID(ctx context.Context, id ID) (*Variable, error)

    // FindVariables returns all variables in the store
    FindVariables(ctx context.Context, filter VariableFilter, opt ...FindOptions) ([]*Variable, error)

    // CreateVariable creates a new variable and assigns it an ID
    CreateVariable(ctx context.Context, m *Variable) error

    // UpdateVariable updates a single variable with a changeset
    UpdateVariable(ctx context.Context, id ID, update *VariableUpdate) (*Variable, error)

    // ReplaceVariable replaces a single variable
    ReplaceVariable(ctx context.Context, variable *Variable) error

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

VariableService describes a service for managing Variables

type VariableUpdate Uses

type VariableUpdate struct {
    Name        string             `json:"name"`
    Selected    []string           `json:"selected"`
    Description string             `json:"description"`
    Arguments   *VariableArguments `json:"arguments"`
}

A VariableUpdate describes a set of changes that can be applied to a Variable

func (*VariableUpdate) Apply Uses

func (u *VariableUpdate) Apply(m *Variable)

Apply applies non-zero fields from a VariableUpdate to a Variable

func (*VariableUpdate) Valid Uses

func (u *VariableUpdate) Valid() error

Valid returns an error if a Variable changeset is not valid

type View Uses

type View struct {
    ViewContents
    Properties ViewProperties
}

View holds positional and visual information for a View.

func (View) MarshalJSON Uses

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

MarshalJSON encodes a view to JSON bytes.

func (*View) UnmarshalJSON Uses

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

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

type ViewColor Uses

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 Uses

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

ViewContents is the id and name of a specific view.

type ViewContentsUpdate Uses

type ViewContentsUpdate struct {
    Name *string `json:"name"`
}

ViewContentsUpdate is a struct for updating the non properties content of a View.

type ViewFilter Uses

type ViewFilter struct {
    ID    *ID
    Types []string
}

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

type ViewProperties Uses

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

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

func UnmarshalViewPropertiesJSON Uses

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

UnmarshalViewPropertiesJSON unmarshals JSON bytes into a ViewProperties.

type ViewUpdate Uses

type ViewUpdate struct {
    ViewContentsUpdate
    Properties ViewProperties
}

ViewUpdate is a struct for updating Views.

func (ViewUpdate) Apply Uses

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

Apply updates a view with the view updates properties.

func (ViewUpdate) MarshalJSON Uses

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

MarshalJSON encodes a view to JSON bytes.

func (*ViewUpdate) UnmarshalJSON Uses

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

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

func (ViewUpdate) Valid Uses

func (u ViewUpdate) Valid() *Error

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

type WriteService Uses

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

WriteService writes data read from the reader.

type XYViewProperties Uses

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"`
    XColumn           string           `json:"xColumn"`
    YColumn           string           `json:"yColumn"`
    ShadeBelow        bool             `json:"shadeBelow"`
    Position          string           `json:"position"`
    TimeFormat        string           `json:"timeFormat"`
    HoverDimension    string           `json:"hoverDimension"`
}

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

func (XYViewProperties) GetType Uses

func (v XYViewProperties) GetType() string

Directories

PathSynopsis
authorization
authorizer
bolt
checks
chronograf
chronograf/bolt
chronograf/bolt/internal
chronograf/canned
chronograf/dist
chronograf/enterprise
chronograf/filestore
chronograf/id
chronograf/influx
chronograf/influx/queries
chronograf/integrations
chronograf/memdb
chronograf/mocks
chronograf/multistore
chronograf/noop
chronograf/oauth2Package oauth2 provides http.Handlers necessary for implementing Oauth2 authentication with multiple Providers.
chronograf/organizations
chronograf/roles
chronograf/server
cmd/chronograf-migrator
cmd/influx
cmd/influx/config
cmd/influxd
cmd/influxd/generate
cmd/influxd/generate/internal/shard
cmd/influxd/inspectinspects low-level details about tsi1 files.
cmd/influxd/internal/profile
cmd/influxd/launcher
cmd/influxd/restore
cmd/influx_inspect/buildtsiPackage buildtsi reads an in-memory index and exports it as a TSI index.
cmd/influx/internal
cmd/telemetryd
context
dbrp
dbrp/mocksPackage mocks is a generated GoMock package.
endpoints
flux
gather
http
http/influxdb
http/legacy
http/metric
http/mock
http/mocksPackage mocks is a generated GoMock package.
http/points
influxql
influxql/control
influxql/mock
inmem
internal
internal/fs
internal/testutil
internal/yaml2json
jsonweb
kit/checkPackage check standardizes /health and /ready endpoints.
kit/cliPackage cli creates simple CLI options with ENV overrides using viper.
kit/errors
kit/featurePackage feature provides feature flagging capabilities for InfluxDB servers.
kit/feature/_codegen
kit/feature/override
kit/grpc
kit/io
kit/metric
kit/promPackage prom provides a wrapper around a prometheus metrics registry so that all services are unified in how they expose prometheus metrics.
kit/prom/promtestPackage promtest provides helpers for parsing and extracting prometheus metrics.
kit/signals
kit/tracing
kit/tracing/testing
kit/transport/http
kvpackage kv
kv/migrationpackage migration
kv/migration/allpackage all
label
logger
mock
modelsPackage models implements basic objects used throughout the TICK stack.
nats
notification
notification/check
notification/endpoint
notification/flux
notification/rule
pkg/binaryutil
pkg/bloom
pkg/bufio
pkg/bytesutil
pkg/csv2lpPackage csv2lp transforms CSV data to InfluxDB line protocol
pkg/data/gen
pkg/encoding/simple8bPackage simple8b implements the 64bit integer encoding algorithm as published by Ann and Moffat in "Index compression using 64-bit words", Softw.
pkgerPackage pkger implements a means to create and consume reusable templates for what will eventually come to support all influxdb resources.
pkger/internal/wordplay
pkg/estimator
pkg/estimator/hllPackage 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.
pkg/file
pkg/fs
pkg/hllPackage 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.
pkg/httpc
pkg/jsonnet
pkg/jsonparser
pkg/lifecycle
pkg/limiterPackage limiter provides concurrency limiters.
pkg/metricsPackage metrics provides various measurements that are safe for concurrent access.
pkg/mincore
pkg/mmapPackage mmap provides a way to memory-map a file.
pkg/pointerPackage pointer provides utilities for pointer handling that aren't available in go.
pkg/poolPackage pool provides pool structures to help reduce garbage collector pressure.
pkg/radix
pkg/rhh
pkg/slicesPackage slices contains functions to operate on slices treated as sets.
pkg/snowflake
pkg/tar
pkg/testing/assertPackage assert provides helper functions that can be used with the standard Go testing package.
pkg/testttp
pkg/tracingPackage tracing provides a way for capturing hierarchical traces.
pkg/tracing/fields
pkg/tracing/labels
pkg/tracing/wirePackage wire is used to serialize a trace.
predicate
prometheus
query
query/builtinPackage builtin ensures all packages related to Flux built-ins are imported and initialized.
query/builtinlazy
query/controlPackage control keeps track of resources and manages queries.
query/fluxlangPackage language exposes the flux parser as an interface.
query/influxqlPackage influxql implements the transpiler for executing influxql queries in the 2.0 query engine.
query/influxql/spectestsPackage spectests the influxql transpiler specification tests.
query/mock
query/promqlPackage promql implements a promql parser to build flux query specifications from promql.
query/querytest
query/stdlib
query/stdlib/experimental
query/stdlib/influxdata/influxdb
query/stdlib/influxdata/influxdb/v1
query/stdlib/testing
rand
resourcePackage resource defines an interface for recording changes to InfluxDB resources.
resource/noop
secret
session
snowflake
source
storage
storage/compatpackage compat helps with migrating toml files from influxdb.
storage/flux
storage/reads
storage/reads/datatypes
storage/readservice
task/backend
task/backend/coordinator
task/backend/executor
task/backend/executor/mockPackage mock is a generated GoMock package.
task/backend/middleware
task/backend/scheduler
task/mockPackage mock contains mock implementations of different task interfaces.
task/optionsPackage options provides ways to extract the task-related options from a Flux script.
task/servicetestPackage servicetest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of influxdb.TaskService.
telegraf/plugins
telegraf/plugins/inputs
telegraf/plugins/outputs
telemetry
tenantThe tenant domain encapsulates all the storage critical metadata services: User Organization Bucket URM's
testing
tomlPackage toml adds support to marshal and unmarshal types not in the official TOML spec.
tsdb/cursors
tsdb/migratePackage migrate provides tooling to migrate data from InfluxDB 1.x to 2.x
tsdb/migrate/internalPackage meta is a generated protocol buffer package.
tsdb/seriesfile
tsdb/value
uuidPackage uuid provides functions to create time-based UUIDs.
v1
v1/coordinatorPackage coordinator contains abstractions for writing points, executing statements, and accessing meta data.
v1/internal
v1/internal/testutil
vault
write
zap

Package influxdb imports 30 packages (graph) and is imported by 90 packages. Updated 2020-09-17. Refresh now. Tools for package owners.