Documentation ¶
Index ¶
- Constants
- Variables
- func CreateMeasurement(org, bucket []byte) ([]byte, error)
- func FindOptionParams(opts ...FindOptions) [][2]string
- func IsActive(a *Authorization) bool
- func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error)
- func NewBuilderTag(key string, functionType string, values ...string) struct{ ... }
- func PermissionAllowed(perm Permission, ps []Permission) bool
- func ReadMeasurement(name []byte) (orgID, bucketID []byte, err error)
- func SetBuildInfo(version, commit, date string)
- func SortDashboards(opts FindOptions, ds []*Dashboard)
- func ValidScraperType(s string) bool
- func ValidateMeasurementSchemaName(name string) error
- type Action
- type AddDashboardCellOptions
- type AnnotationCreate
- type AnnotationDeleteFilter
- type AnnotationEvent
- type AnnotationList
- type AnnotationListFilter
- type AnnotationService
- type AnnotationStickers
- type Authorization
- type AuthorizationFilter
- type AuthorizationService
- type AuthorizationUpdate
- type Authorizer
- type AuthorizerV1
- type Axis
- type BackupService
- type BandViewProperties
- type BasicFilter
- type BasicStream
- type Bucket
- type BucketFilter
- type BucketManifestWriter
- type BucketMetadataManifest
- type BucketOperationLogService
- type BucketService
- type BucketType
- type BucketUpdate
- type BuildInfo
- type BuilderConfig
- type CRUDLog
- type CRUDLogSetter
- type Cell
- type CellProperty
- type CellUpdate
- type Check
- type CheckCreate
- type CheckFilter
- type CheckService
- type CheckUpdate
- type CheckViewProperties
- type CreateRemoteConnectionRequest
- type CreateReplicationRequest
- type CredentialsV1
- type DBRPMapping
- type DBRPMappingFilter
- type DBRPMappingService
- type Dashboard
- type DashboardFilter
- type DashboardMeta
- type DashboardOperationLogService
- type DashboardQuery
- type DashboardService
- type DashboardUpdate
- type Datum
- type DecimalPlaces
- type DeleteService
- type Document
- type DocumentMeta
- type DocumentService
- type DocumentStore
- type Duration
- type EmptyViewProperties
- type FindOptions
- type GaugeViewProperties
- type GeoLayer
- type GeoViewProperties
- type HeatmapViewProperties
- type HistogramViewProperties
- type KeyValueLog
- type Label
- type LabelFilter
- type LabelMapping
- type LabelMappingFilter
- type LabelService
- type LabelUpdate
- type Lease
- type Limit
- type LinePlusSingleStatProperties
- type LogColumnSetting
- type LogViewProperties
- type LogViewerColumn
- type LookupService
- type Manifest
- type ManifestEntry
- type ManifestKVEntry
- type MappingType
- type MarkdownViewProperties
- type MeasurementSchema
- type MeasurementSchemaColumn
- type MosaicViewProperties
- type Notebook
- type NotebookListFilter
- type NotebookReqBody
- type NotebookService
- type NotebookSpec
- type NotificationEndpoint
- type NotificationEndpointFilter
- type NotificationEndpointService
- type NotificationEndpointUpdate
- type NotificationRule
- type NotificationRuleCreate
- type NotificationRuleFilter
- type NotificationRuleStore
- type NotificationRuleUpdate
- type OnboardingRequest
- type OnboardingResults
- type OnboardingService
- type OperationLogEntry
- type Operator
- type Organization
- type OrganizationFilter
- type OrganizationOperationLogService
- type OrganizationService
- type OrganizationUpdate
- type Page
- type PagingFilter
- type PagingLinks
- type PasswordsService
- type Permission
- func MePermissions(userID platform.ID) []Permission
- func MemberBucketPermission(bucketID platform.ID) Permission
- func MemberPermissions(orgID platform.ID) []Permission
- func NewGlobalPermission(a Action, rt ResourceType) (*Permission, error)
- func NewPermission(a Action, rt ResourceType, orgID platform.ID) (*Permission, error)
- func NewPermissionAtID(id platform.ID, a Action, rt ResourceType, orgID platform.ID) (*Permission, error)
- func NewResourcePermission(a Action, rt ResourceType, rid platform.ID) (*Permission, error)
- func OperPermissions() []Permission
- func OwnerPermissions(orgID platform.ID) []Permission
- func ReadAllPermissions() []Permission
- type PermissionSet
- type Predicate
- type ReadAnnotation
- type ReadAnnotations
- type ReadStream
- type RealTimeGenerator
- type RemoteConnection
- type RemoteConnectionListFilter
- type RemoteConnections
- type RenamableField
- type Replication
- type ReplicationHTTPConfig
- type ReplicationListFilter
- type Replications
- type Resource
- type ResourceType
- type RestoreService
- type RestoredBucketMappings
- type RestoredShardMapping
- type RetentionPolicyManifest
- type ScatterViewProperties
- type SchemaColumnDataType
- type SchemaType
- type SchemeV1
- type ScraperTarget
- type ScraperTargetFilter
- type ScraperTargetStoreService
- type ScraperType
- type SecretField
- type SecretService
- type SemanticColumnType
- type Semaphore
- type Session
- type SessionService
- type ShardGroupManifest
- type ShardManifest
- type ShardOwner
- type SingleStatViewProperties
- type Source
- type SourceFields
- type SourceService
- type SourceType
- type SourceUpdate
- type SqlBackupRestoreService
- type StaticLegend
- type Status
- type StoredAnnotation
- type StoredStream
- type Stream
- type StreamListFilter
- type SubscriptionManifest
- type TableOptions
- type TableViewProperties
- type Tag
- type TagRule
- type TelegrafConfig
- type TelegrafConfigFilter
- type TelegrafConfigStore
- type TimeGenerator
- type Timespan
- type TokenGenerator
- type TrackedReplication
- type UpdateRemoteConnectionRequest
- type UpdateReplicationRequest
- type Usage
- type UsageFilter
- type UsageMetric
- type UsageService
- type User
- type UserFilter
- type UserOperationLogService
- type UserResourceMapping
- type UserResourceMappingFilter
- type UserResourceMappingService
- type UserResponse
- type UserService
- type UserStatus
- type UserType
- type UserUpdate
- type V1SourceFields
- type Variable
- type VariableArguments
- type VariableConstantValues
- type VariableFilter
- type VariableMapValues
- type VariableQueryValues
- type VariableService
- type VariableUpdate
- type View
- type ViewColor
- type ViewContents
- type ViewContentsUpdate
- type ViewFilter
- type ViewProperties
- type ViewUpdate
- type WriteService
- type XYViewProperties
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 // NotebooksResourceType gives permission to one or more notebooks. NotebooksResourceType = ResourceType("notebooks") // 18 // AnnotationsResourceType gives permission to one or more annotations. AnnotationsResourceType = ResourceType("annotations") // 19 // RemotesResourceType gives permission to one or more remote connections. RemotesResourceType = ResourceType("remotes") // 20 // ReplicationsResourceType gives permission to one or more replications. ReplicationsResourceType = ResourceType("replications") // 21 // InstanceResourceType is a special permission that allows ownership of the entire instance (creating orgs/operator tokens/etc) InstanceResourceType = ResourceType("instance") // 22 )
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" ViewPropertyTypeGeo = "geo" )
Values for all supported view property types.
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 ( MinReplicationMaxQueueSizeBytes int64 = 33554430 // 32 MiB DefaultReplicationMaxQueueSizeBytes = 2 * MinReplicationMaxQueueSizeBytes DefaultReplicationMaxAge int64 = 604800 // 1 week, in seconds )
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 ( 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 (
BackupFilenamePattern = "20060102T150405Z"
)
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 InfiniteRetention = 0
InfiniteRetention is default infinite retention period.
const (
// PrometheusScraperType parses metrics from a prometheus endpoint.
PrometheusScraperType = "prometheus"
)
Scraper types
const SessionAuthorizationKind = "session"
SessionAuthorizationKind 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 ( // ErrLabelNameisEmpty is error when org name is empty ErrLabelNameisEmpty = &errors.Error{ Code: errors.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 = &errors.Error{ Code: errors.EConflict, Msg: "Cannot add label, label already exists on resource", } )
errors on label
var ( ErrMeasurementSchemaNameTooShort = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "too short", } ErrMeasurementSchemaNameTooLong = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "too long", } ErrMeasurementSchemaNameUnderscore = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "must not begin with _", } ErrMeasurementSchemaNameQuotes = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "must not contains single or double quotes", } ErrMeasurementSchemaColumnsMissing = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns missing", } ErrMeasurementSchemaColumnsMissingTime = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns missing time column with a timestamp semantic", } ErrMeasurementSchemaColumnsTimeInvalidSemantic = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema contains a time column with an invalid semantic", } ErrMeasurementSchemaColumnsTimestampSemanticInvalidName = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns contains a timestamp column that is not named time", } ErrMeasurementSchemaColumnsTimestampSemanticDataType = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns contains a time column with a data type", } ErrMeasurementSchemaColumnsTagSemanticDataType = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns contains a tag column with a data type", } ErrMeasurementSchemaColumnsFieldSemanticMissingDataType = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns contains a field column with missing data type", } ErrMeasurementSchemaColumnsMissingFields = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns requires at least one field type column", } ErrMeasurementSchemaColumnsDuplicateNames = &influxerror.Error{ Code: influxerror.EInvalid, Msg: "measurement schema columns contains duplicate column names", } )
var ( ErrOrgIDRequired = fieldRequiredError("OrgID") ErrNameRequired = fieldRequiredError("Name") ErrSpecRequired = fieldRequiredError("Spec") ErrOffsetNegative = &errors.Error{ Code: errors.EInvalid, Msg: "offset cannot be negative", } ErrLimitLTEZero = &errors.Error{ Code: errors.EInvalid, Msg: "limit cannot be less-than or equal-to zero", } ErrNotebookNotFound = &errors.Error{ Code: errors.ENotFound, Msg: "notebook not found", } )
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 ( 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, NotebooksResourceType, AnnotationsResourceType, RemotesResourceType, ReplicationsResourceType, InstanceResourceType, }
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 ( // authorized. ErrCredentialsUnauthorized = &errors.Error{ Code: errors.EUnauthorized, Msg: "Unauthorized", } )
var ( // ErrInvalidNotificationEndpointType denotes that the provided NotificationEndpoint is not a valid type ErrInvalidNotificationEndpointType = errors.New("unknown notification endpoint type") )
var ErrInvalidOrgFilter = &errors.Error{ Code: errors.EInvalid, Msg: "Please provide either orgID or org", }
ErrInvalidOrgFilter is the error indicate org filter is empty
var ErrMaxQueueSizeTooSmall = errors.Error{ Code: errors.EInvalid, Msg: fmt.Sprintf("maxQueueSize too small, must be at least %d", MinReplicationMaxQueueSizeBytes), }
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 = &errors.Error{ Code: errors.EInvalid, Msg: "org name is empty", } )
errors of org
var ErrUnableToCreateToken = &errors.Error{ Msg: "unable to create token", Code: errors.EInvalid, }
ErrUnableToCreateToken sanitized error message for all errors when a user cannot create a token
var RenewSessionTime = time.Duration(time.Second * 300)
RenewSessionTime is the time to extend session, currently set to 5min.
Functions ¶
func CreateMeasurement ¶
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 FindOptionParams ¶
func FindOptionParams(opts ...FindOptions) [][2]string
func MarshalViewPropertiesJSON ¶
func MarshalViewPropertiesJSON(v ViewProperties) ([]byte, error)
MarshalViewPropertiesJSON encodes a view into JSON bytes.
func NewBuilderTag ¶
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 ¶
func PermissionAllowed(perm Permission, ps []Permission) bool
PermissionAllowed determines if a permission is allowed.
func ReadMeasurement ¶
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 ¶
func SetBuildInfo(version, commit, date string)
SetBuildInfo sets the build information for the binary.
func SortDashboards ¶
func SortDashboards(opts FindOptions, ds []*Dashboard)
SortDashboards sorts a slice of dashboards by a field.
func ValidScraperType ¶
ValidScraperType returns true is the type string is valid
func ValidateMeasurementSchemaName ¶ added in v2.1.0
ValidateMeasurementSchemaName determines if name is a valid identifier for a measurement schema or column name and if not, returns an error.
Types ¶
type AddDashboardCellOptions ¶
type AddDashboardCellOptions struct {
View *View
}
AddDashboardCellOptions are options for adding a dashboard.
type AnnotationCreate ¶ added in v2.1.0
type AnnotationCreate struct { StreamTag string `json:"stream,omitempty"` // StreamTag provides a means to logically group a set of annotated events. Summary string `json:"summary"` // Summary is the only field required to annotate an event. Message string `json:"message,omitempty"` // Message provides more details about the event being annotated. Stickers AnnotationStickers `json:"stickers,omitempty"` // Stickers are like tags, but named something obscure to differentiate them from influx tags. They are there to differentiate an annotated event. EndTime *time.Time `json:"endTime,omitempty"` // EndTime is the time of the event being annotated. Defaults to now if not set. StartTime *time.Time `json:"startTime,omitempty"` // StartTime is the start time of the event being annotated. Defaults to EndTime if not set. }
AnnotationCreate contains user providable fields for annotating an event.
type AnnotationDeleteFilter ¶ added in v2.1.0
type AnnotationDeleteFilter struct { StreamTag string `json:"stream,omitempty"` // StreamTag provides a means to logically group a set of annotated events. StreamID platform.ID `json:"streamID,omitempty"` // StreamID provides a means to logically group a set of annotated events. Stickers map[string]string `json:"stickers,omitempty"` // Stickers are like tags, but named something obscure to differentiate them from influx tags. They are there to differentiate an annotated event. EndTime *time.Time `json:"endTime,omitempty"` // EndTime is the time of the event being annotated. Defaults to now if not set. StartTime *time.Time `json:"startTime,omitempty"` // StartTime is the start time of the event being annotated. Defaults to EndTime if not set. }
AnnotationDeleteFilter contains fields for deleting an annotated event.
func (*AnnotationDeleteFilter) SetStickers ¶ added in v2.1.0
func (a *AnnotationDeleteFilter) SetStickers(vals map[string][]string)
SetStickers sets the stickers from the query parameters.
func (*AnnotationDeleteFilter) Validate ¶ added in v2.1.0
func (a *AnnotationDeleteFilter) Validate() error
Validate validates the deletion object.
type AnnotationEvent ¶ added in v2.1.0
type AnnotationEvent struct { ID platform.ID `json:"id,omitempty"` // ID is the annotation ID. AnnotationCreate // AnnotationCreate defines the common input/output bits of an annotation. }
AnnotationEvent contains fields for annotating an event.
type AnnotationList ¶ added in v2.1.0
type AnnotationList struct { StreamTag string `json:"stream"` Annotations []ReadAnnotation `json:"annotations"` }
AnnotationList defines the structure of the response when listing annotations.
type AnnotationListFilter ¶ added in v2.1.0
type AnnotationListFilter struct { StickerIncludes AnnotationStickers `json:"stickerIncludes,omitempty"` // StickerIncludes allows the user to filter annotated events based on it's sticker. StreamIncludes []string `json:"streamIncludes,omitempty"` // StreamIncludes allows the user to filter annotated events by stream. BasicFilter }
AnnotationListFilter is a selection filter for listing annotations.
func (*AnnotationListFilter) SetStickerIncludes ¶ added in v2.1.0
func (f *AnnotationListFilter) SetStickerIncludes(vals map[string][]string)
SetStickerIncludes sets the stickerIncludes from the query parameters.
type AnnotationService ¶ added in v2.1.0
type AnnotationService interface { // CreateAnnotations creates annotations. CreateAnnotations(ctx context.Context, orgID platform.ID, create []AnnotationCreate) ([]AnnotationEvent, error) // ListAnnotations lists all annotations matching the filter. ListAnnotations(ctx context.Context, orgID platform.ID, filter AnnotationListFilter) ([]StoredAnnotation, error) // GetAnnotation gets an annotation by id. GetAnnotation(ctx context.Context, id platform.ID) (*StoredAnnotation, error) // DeleteAnnotations deletes annotations matching the filter. DeleteAnnotations(ctx context.Context, orgID platform.ID, delete AnnotationDeleteFilter) error // DeleteAnnotation deletes an annotation by id. DeleteAnnotation(ctx context.Context, id platform.ID) error // UpdateAnnotation updates an annotation. UpdateAnnotation(ctx context.Context, id platform.ID, update AnnotationCreate) (*AnnotationEvent, error) // ListStreams lists all streams matching the filter. ListStreams(ctx context.Context, orgID platform.ID, filter StreamListFilter) ([]StoredStream, error) // CreateOrUpdateStream creates or updates the matching stream by name. CreateOrUpdateStream(ctx context.Context, orgID platform.ID, stream Stream) (*ReadStream, error) // GetStream gets a stream by id. Currently this is only used for authorization, and there are no // API routes for getting a single stream by ID. GetStream(ctx context.Context, id platform.ID) (*StoredStream, error) // UpdateStream updates the stream by the ID. UpdateStream(ctx context.Context, id platform.ID, stream Stream) (*ReadStream, error) // DeleteStreams deletes one or more streams by name. DeleteStreams(ctx context.Context, orgID platform.ID, delete BasicStream) error // DeleteStreamByID deletes the stream metadata by id. DeleteStreamByID(ctx context.Context, id platform.ID) error }
AnnotationService is the service contract for Annotations
type AnnotationStickers ¶ added in v2.1.0
func (*AnnotationStickers) Scan ¶ added in v2.1.0
func (a *AnnotationStickers) Scan(value interface{}) error
Scan implements the database/sql Scanner interface for retrieving AnnotationStickers from the database The string is decoded into a slice of strings, which are then converted back into a map
func (AnnotationStickers) Value ¶ added in v2.1.0
func (a AnnotationStickers) Value() (driver.Value, error)
Value implements the database/sql Valuer interface for adding AnnotationStickers to the database Stickers are stored in the database as a slice of strings like "[key=val]" They are encoded into a JSON string for storing into the database, and the JSON sqlite extension is able to manipulate them like an object.
type Authorization ¶
type Authorization struct { ID platform.ID `json:"id"` Token string `json:"token"` Status Status `json:"status"` Description string `json:"description"` OrgID platform.ID `json:"orgID"` UserID platform.ID `json:"userID,omitempty"` Permissions []Permission `json:"permissions"` CRUDLog }
Authorization is an authorization. 🎉
func (*Authorization) GetUserID ¶
func (a *Authorization) GetUserID() platform.ID
GetUserID returns the user id.
func (*Authorization) Identifier ¶
func (a *Authorization) Identifier() platform.ID
Identifier returns the authorizations ID and is used for auditing.
func (*Authorization) IsActive ¶
func (a *Authorization) IsActive() bool
IsActive returns true if the authorization active.
func (*Authorization) Kind ¶
func (a *Authorization) Kind() string
Kind returns session and is used for auditing.
func (*Authorization) PermissionSet ¶
func (a *Authorization) PermissionSet() (PermissionSet, error)
PermissionSet returns the set of permissions associated with the Authorization.
func (*Authorization) Valid ¶
func (a *Authorization) Valid() error
Valid ensures that the authorization is valid.
type AuthorizationFilter ¶
type AuthorizationFilter struct { Token *string ID *platform.ID UserID *platform.ID User *string OrgID *platform.ID Org *string }
AuthorizationFilter represents a set of filter that restrict the returned results.
type AuthorizationService ¶
type AuthorizationService interface { // Returns a single authorization by ID. FindAuthorizationByID(ctx context.Context, id platform.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 platform.ID, upd *AuthorizationUpdate) (*Authorization, error) // Removes a authorization by token. DeleteAuthorization(ctx context.Context, id platform.ID) error }
AuthorizationService represents a service for managing authorization data.
type AuthorizationUpdate ¶
type AuthorizationUpdate struct { Status *Status `json:"status,omitempty"` Description *string `json:"description,omitempty"` }
AuthorizationUpdate is the authorization update request.
type Authorizer ¶
type Authorizer interface { // PermissionSet returns the PermissionSet associated with the authorizer PermissionSet() (PermissionSet, error) // ID returns an identifier used for auditing. Identifier() platform.ID // GetUserID returns the user id. GetUserID() platform.ID // Kind metadata for auditing. Kind() string }
Authorizer will authorize a permission.
type AuthorizerV1 ¶
type AuthorizerV1 interface {
Authorize(ctx context.Context, v1 CredentialsV1) (*Authorization, error)
}
type Axis ¶
type Axis struct { Bounds []string `json:"bounds"` // bounds are an arbitrary list of client-defined strings that specify the viewport for a View LegacyBounds [2]int64 `json:"-"` // legacy bounds are for testing a migration from an earlier version of axis Label string `json:"label"` // label is a description of this Axis Prefix string `json:"prefix"` // Prefix represents a label prefix for formatting axis values Suffix string `json:"suffix"` // Suffix represents a label suffix for formatting axis values Base string `json:"base"` // Base represents the radix for formatting axis values Scale string `json:"scale"` // Scale is the axis formatting scale. Supported: "log", "linear" }
Axis represents the visible extents of a visualization
type BackupService ¶
type BackupService interface { // BackupKVStore creates a live backup copy of the metadata database. BackupKVStore(ctx context.Context, w io.Writer) error // BackupShard downloads a backup file for a single shard. BackupShard(ctx context.Context, w io.Writer, shardID uint64, since time.Time) error // RLockKVStore locks the database. RLockKVStore() // RUnlockKVStore unlocks the database. RUnlockKVStore() }
BackupService represents the data backup functions of InfluxDB.
type BandViewProperties ¶
type BandViewProperties struct { Queries []DashboardQuery `json:"queries"` Axes map[string]Axis `json:"axes"` Type string `json:"type"` StaticLegend StaticLegend `json:"staticLegend"` 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"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YColumn string `json:"yColumn"` GenerateYAxisTicks []string `json:"generateYAxisTicks"` YTotalTicks int `json:"yTotalTicks"` YTickStart float64 `json:"yTickStart"` YTickStep float64 `json:"yTickStep"` UpperColumn string `json:"upperColumn"` MainColumn string `json:"mainColumn"` LowerColumn string `json:"lowerColumn"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
BandViewProperties represents options for the band view
func (BandViewProperties) GetType ¶
func (v BandViewProperties) GetType() string
type BasicFilter ¶ added in v2.1.0
type BasicFilter struct { StartTime *time.Time `json:"startTime,omitempty"` // StartTime is the time the event being annotated started. EndTime *time.Time `json:"endTime,omitempty"` // EndTime is the time the event being annotated ended. }
BasicFilter defines common filter options.
type BasicStream ¶ added in v2.1.0
type BasicStream struct {
Names []string `json:"stream"`
}
BasicStream defines a stream by name. Used for stream deletes.
func (BasicStream) IsValid ¶ added in v2.1.0
func (s BasicStream) IsValid() bool
IsValid validates the stream is not empty.
type Bucket ¶
type Bucket struct { ID platform.ID `json:"id,omitempty"` OrgID platform.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"` ShardGroupDuration time.Duration `json:"shardGroupDuration"` CRUDLog }
Bucket is a bucket. 🎉
type BucketFilter ¶
BucketFilter represents a set of filter that restrict the returned results.
func (BucketFilter) QueryParams ¶
func (f BucketFilter) QueryParams() map[string][]string
QueryParams Converts BucketFilter fields to url query params.
func (BucketFilter) String ¶
func (f BucketFilter) String() string
String returns a human-readable string of the BucketFilter, particularly useful for error messages.
type BucketManifestWriter ¶ added in v2.1.0
type BucketMetadataManifest ¶ added in v2.1.0
type BucketMetadataManifest struct { OrganizationID platform.ID `json:"organizationID"` OrganizationName string `json:"organizationName"` BucketID platform.ID `json:"bucketID"` BucketName string `json:"bucketName"` Description *string `json:"description,omitempty"` DefaultRetentionPolicy string `json:"defaultRetentionPolicy"` RetentionPolicies []RetentionPolicyManifest `json:"retentionPolicies"` }
BucketMetadataManifest contains the information about a bucket for backup purposes. It is composed of various nested structs below.
type BucketOperationLogService ¶
type BucketOperationLogService interface { // GetBucketOperationLog retrieves the operation log for the bucket with the provided id. GetBucketOperationLog(ctx context.Context, id platform.ID, opts FindOptions) ([]*OperationLogEntry, int, error) }
BucketOperationLogService is an interface for retrieving the operation log for a bucket.
type BucketService ¶
type BucketService interface { // FindBucketByID returns a single bucket by ID. FindBucketByID(ctx context.Context, id platform.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 platform.ID, upd BucketUpdate) (*Bucket, error) // DeleteBucket removes a bucket by ID. DeleteBucket(ctx context.Context, id platform.ID) error FindBucketByName(ctx context.Context, orgID platform.ID, name string) (*Bucket, error) }
BucketService represents a service for managing bucket data.
type BucketType ¶
type BucketType int
BucketType differentiates system buckets from user buckets.
func ParseBucketType ¶
func ParseBucketType(s string) BucketType
ParseBucketType parses a bucket type from a string
func (BucketType) String ¶
func (bt BucketType) String() string
String converts a BucketType into a human-readable string.
type BucketUpdate ¶
type BucketUpdate struct { Name *string Description *string RetentionPeriod *time.Duration ShardGroupDuration *time.Duration }
BucketUpdate represents updates to a bucket. Only fields which are set are updated.
type BuildInfo ¶
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 ¶
func GetBuildInfo() BuildInfo
GetBuildInfo returns the current build information for the binary.
type BuilderConfig ¶
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 ¶
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 ¶
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 ¶
SetCreatedAt set the created time.
func (*CRUDLog) SetUpdatedAt ¶
SetUpdatedAt set the updated time.
type CRUDLogSetter ¶
CRUDLogSetter is the interface to set the crudlog.
type Cell ¶
type Cell struct { ID platform.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) UnmarshalJSON ¶
type CellProperty ¶
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 ¶
type CellUpdate struct { X *int32 `json:"x"` Y *int32 `json:"y"` W *int32 `json:"w"` H *int32 `json:"h"` }
CellUpdate is the patch structure for a cell.
func (CellUpdate) Apply ¶
func (u CellUpdate) Apply(c *Cell) error
Apply applies an update to a Cell.
func (CellUpdate) Valid ¶
func (u CellUpdate) Valid() *errors.Error
Valid returns an error if the cell update is invalid.
type Check ¶
type Check interface { Valid(lang fluxlang.FluxLanguageService) error Type() string ClearPrivateData() SetTaskID(platform.ID) GetTaskID() platform.ID GetOwnerID() platform.ID SetOwnerID(platform.ID) GenerateFlux(lang fluxlang.FluxLanguageService) (string, error) json.Marshaler CRUDLogSetter SetID(id platform.ID) SetOrgID(id platform.ID) SetName(name string) SetDescription(description string) GetID() platform.ID GetCRUDLog() CRUDLog GetOrgID() platform.ID GetName() string GetDescription() string }
Check represents the information required to generate a periodic check task.
type CheckCreate ¶
CheckCreate represent data to create a new Check
type CheckFilter ¶
type CheckFilter struct { ID *platform.ID Name *string OrgID *platform.ID Org *string UserResourceMappingFilter }
CheckFilter represents a set of filters that restrict the returned results.
func (CheckFilter) QueryParams ¶
func (f CheckFilter) QueryParams() map[string][]string
QueryParams Converts CheckFilter fields to url query params.
type CheckService ¶
type CheckService interface { // FindCheckByID returns a single check by ID. FindCheckByID(ctx context.Context, id platform.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 platform.ID) error // UpdateCheck updates the whole check. // Returns the new check state after update. UpdateCheck(ctx context.Context, id platform.ID, c CheckCreate) (Check, error) // PatchCheck updates a single bucket with changeset. // Returns the new check state after update. PatchCheck(ctx context.Context, id platform.ID, upd CheckUpdate) (Check, error) // DeleteCheck will delete the check by id. DeleteCheck(ctx context.Context, id platform.ID) error }
CheckService represents a service for managing checks.
type CheckUpdate ¶
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 ¶
func (n *CheckUpdate) Valid() error
Valid returns err is the update is invalid.
type CheckViewProperties ¶
type CheckViewProperties struct { Type string `json:"type"` CheckID string `json:"checkID"` Queries []DashboardQuery `json:"queries"` ViewColors []string `json:"colors"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
CheckViewProperties represents options for a view representing a check
func (CheckViewProperties) GetType ¶
func (v CheckViewProperties) GetType() string
type CreateRemoteConnectionRequest ¶ added in v2.2.0
type CreateRemoteConnectionRequest struct { OrgID platform.ID `json:"orgID"` Name string `json:"name"` Description *string `json:"description,omitempty"` RemoteURL string `json:"remoteURL"` RemoteToken string `json:"remoteAPIToken"` RemoteOrgID *platform.ID `json:"remoteOrgID"` AllowInsecureTLS bool `json:"allowInsecureTLS"` }
CreateRemoteConnectionRequest contains all info needed to establish a new connection to a remote InfluxDB instance.
type CreateReplicationRequest ¶ added in v2.2.0
type CreateReplicationRequest struct { OrgID platform.ID `json:"orgID"` Name string `json:"name"` Description *string `json:"description,omitempty"` RemoteID platform.ID `json:"remoteID"` LocalBucketID platform.ID `json:"localBucketID"` RemoteBucketID platform.ID `json:"remoteBucketID"` RemoteBucketName string `json:"remoteBucketName"` MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes,omitempty"` DropNonRetryableData bool `json:"dropNonRetryableData,omitempty"` MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` }
CreateReplicationRequest contains all info needed to establish a new replication to a remote InfluxDB bucket.
func (*CreateReplicationRequest) OK ¶ added in v2.2.0
func (r *CreateReplicationRequest) OK() error
type CredentialsV1 ¶
CredentialsV1 encapsulates the required credentials to authorize a v1 HTTP request.
type DBRPMapping ¶
type DBRPMapping struct { ID platform.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"` // Virtual indicates if this is a virtual mapping (tied to bucket name) or physical Virtual bool `json:"virtual"` OrganizationID platform.ID `json:"orgID"` BucketID platform.ID `json:"bucketID"` }
DBRPMapping represents a mapping of a database and retention policy to an organization ID and bucket ID.
func (*DBRPMapping) Equal ¶
func (m *DBRPMapping) Equal(o *DBRPMapping) bool
Equal checks if the two mappings are identical.
func (DBRPMapping) Validate ¶
func (m DBRPMapping) Validate() error
Validate reports any validation errors for the mapping.
type DBRPMappingFilter ¶
type DBRPMappingFilter struct { ID *platform.ID OrgID *platform.ID BucketID *platform.ID Database *string RetentionPolicy *string Default *bool Virtual *bool }
DBRPMappingFilter represents a set of filters that restrict the returned results.
func (DBRPMappingFilter) String ¶
func (f DBRPMappingFilter) String() string
type DBRPMappingService ¶
type DBRPMappingService 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 platform.ID) (*DBRPMapping, error) // FindMany returns a list of dbrp mappings that match filter and the total count of matching dbrp mappings. FindMany(ctx context.Context, dbrp DBRPMappingFilter, opts ...FindOptions) ([]*DBRPMapping, int, error) // Create creates a new dbrp mapping, if a different mapping exists an error is returned. Create(ctx context.Context, dbrp *DBRPMapping) error // Update a new dbrp mapping Update(ctx context.Context, dbrp *DBRPMapping) 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 platform.ID) error }
DBRPMappingService provides CRUD to DBRPMappingV2s.
type Dashboard ¶
type Dashboard struct { ID platform.ID `json:"id,omitempty"` OrganizationID platform.ID `json:"orgID,omitempty"` Name string `json:"name"` Description string `json:"description"` Cells []*Cell `json:"cells"` Meta DashboardMeta `json:"meta"` OwnerID *platform.ID `json:"owner,omitempty"` }
Dashboard represents all visual and query data for a dashboard.
type DashboardFilter ¶
type DashboardFilter struct { IDs []*platform.ID OrganizationID *platform.ID Organization *string OwnerID *platform.ID }
DashboardFilter is a filter for dashboards.
func (DashboardFilter) QueryParams ¶
func (f DashboardFilter) QueryParams() map[string][]string
QueryParams turns a dashboard filter into query params
It implements PagingFilter.
type DashboardMeta ¶
type DashboardMeta struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
DashboardMeta contains meta information about dashboards
type DashboardOperationLogService ¶
type DashboardOperationLogService interface { // GetDashboardOperationLog retrieves the operation log for the dashboard with the provided id. GetDashboardOperationLog(ctx context.Context, id platform.ID, opts FindOptions) ([]*OperationLogEntry, int, error) }
DashboardOperationLogService is an interface for retrieving the operation log for a dashboard.
type DashboardQuery ¶
type DashboardQuery struct { Text string `json:"text"` EditMode string `json:"editMode"` // Either "builder" or "advanced" Name string `json:"name"` // Term or phrase that refers to the query BuilderConfig BuilderConfig `json:"builderConfig"` }
DashboardQuery represents a query used in a dashboard cell
type DashboardService ¶
type DashboardService interface { // FindDashboardByID returns a single dashboard by ID. FindDashboardByID(ctx context.Context, id platform.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 platform.ID, upd DashboardUpdate) (*Dashboard, error) // AddDashboardCell adds a cell to a dashboard. AddDashboardCell(ctx context.Context, id platform.ID, c *Cell, opts AddDashboardCellOptions) error // RemoveDashboardCell removes a dashboard. RemoveDashboardCell(ctx context.Context, dashboardID, cellID platform.ID) error // UpdateDashboardCell replaces the dashboard cell with the provided ID. UpdateDashboardCell(ctx context.Context, dashboardID, cellID platform.ID, upd CellUpdate) (*Cell, error) // GetDashboardCellView retrieves a dashboard cells view. GetDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID) (*View, error) // UpdateDashboardCellView retrieves a dashboard cells view. UpdateDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID, upd ViewUpdate) (*View, error) // DeleteDashboard removes a dashboard by ID. DeleteDashboard(ctx context.Context, id platform.ID) error // ReplaceDashboardCells replaces all cells in a dashboard ReplaceDashboardCells(ctx context.Context, id platform.ID, c []*Cell) error }
DashboardService represents a service for managing dashboard data.
type DashboardUpdate ¶
type DashboardUpdate struct { Name *string `json:"name"` Description *string `json:"description"` Cells *[]*Cell `json:"cells"` }
DashboardUpdate is the patch structure for a dashboard.
func (DashboardUpdate) Apply ¶
func (u DashboardUpdate) Apply(d *Dashboard) error
Apply applies an update to a dashboard.
func (DashboardUpdate) Valid ¶
func (u DashboardUpdate) Valid() *errors.Error
Valid returns an error if the dashboard update is invalid.
type DecimalPlaces ¶
DecimalPlaces indicates whether decimal places should be enforced, and how many digits it should show.
type DeleteService ¶
type DeleteService interface {
DeleteBucketRangePredicate(ctx context.Context, orgID, bucketID platform.ID, min, max int64, pred Predicate, measurement influxql.Expr) error
}
DeleteService will delete a bucket from the range and predict.
type Document ¶
type Document struct { ID platform.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[platform.ID]UserType `json:"-"` }
Document is a generic structure for stating data.
type DocumentMeta ¶
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 ¶
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 ¶
type DocumentStore interface { CreateDocument(ctx context.Context, d *Document) error FindDocument(ctx context.Context, id platform.ID) (*Document, error) FindDocuments(ctx context.Context, orgID platform.ID) ([]*Document, 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 ¶
Duration is based on time.Duration to embed in any struct.
func (Duration) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
type EmptyViewProperties ¶
type EmptyViewProperties struct{}
EmptyViewProperties is visualization that has no values
func (EmptyViewProperties) GetType ¶
func (v EmptyViewProperties) GetType() string
type FindOptions ¶
FindOptions represents options passed to all find methods with multiple results.
func DecodeFindOptions ¶
func DecodeFindOptions(r *http.Request) (*FindOptions, error)
DecodeFindOptions returns a FindOptions decoded from http request.
func (*FindOptions) GetLimit ¶
func (f *FindOptions) GetLimit() int
GetLimit returns the resolved limit between then limit boundaries. Given a limit <= 0 it returns the default limit.
func (FindOptions) QueryParams ¶
func (f FindOptions) QueryParams() map[string][]string
QueryParams returns a map containing url query params.
type GaugeViewProperties ¶
type GaugeViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` Prefix string `json:"prefix"` 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 ¶
func (v GaugeViewProperties) GetType() string
type GeoLayer ¶ added in v2.1.0
type GeoLayer struct { Type string `json:"type"` RadiusField string `json:"radiusField"` ColorField string `json:"colorField"` IntensityField string `json:"intensityField"` // circle layer properties ViewColors []ViewColor `json:"colors"` Radius int32 `json:"radius"` Blur int32 `json:"blur"` RadiusDimension Axis `json:"radiusDimension,omitempty"` ColorDimension Axis `json:"colorDimension,omitempty"` IntensityDimension Axis `json:"intensityDimension,omitempty"` InterpolateColors bool `json:"interpolateColors"` // track layer properties TrackWidth int32 `json:"trackWidth"` Speed int32 `json:"speed"` RandomColors bool `json:"randomColors"` // point layer properties IsClustered bool `json:"isClustered"` }
Single visualization layer properties of a chronograf map widget
type GeoViewProperties ¶ added in v2.1.0
type GeoViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` Center Datum `json:"center"` Zoom float64 `json:"zoom"` MapStyle string `json:"mapStyle"` AllowPanAndZoom bool `json:"allowPanAndZoom"` DetectCoordinateFields bool `json:"detectCoordinateFields"` ViewColor []ViewColor `json:"colors"` GeoLayers []GeoLayer `json:"layers"` Note string `json:"note"` ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` }
GeoViewProperties represents options for map view in Chronograf
func (GeoViewProperties) GetType ¶ added in v2.1.0
func (v GeoViewProperties) GetType() string
type HeatmapViewProperties ¶
type HeatmapViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` ViewColors []string `json:"colors"` BinSize int32 `json:"binSize"` XColumn string `json:"xColumn"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YColumn string `json:"yColumn"` GenerateYAxisTicks []string `json:"generateYAxisTicks"` YTotalTicks int `json:"yTotalTicks"` YTickStart float64 `json:"yTickStart"` YTickStep float64 `json:"yTickStep"` 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"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
HeatmapViewProperties represents options for heatmap view in Chronograf
func (HeatmapViewProperties) GetType ¶
func (v HeatmapViewProperties) GetType() string
type HistogramViewProperties ¶
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"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
HistogramViewProperties represents options for histogram view in Chronograf
func (HistogramViewProperties) GetType ¶
func (v HistogramViewProperties) GetType() string
type KeyValueLog ¶
type KeyValueLog interface { // AddLogEntry adds an entry (v,t) to the log defined for the key k. AddLogEntry(ctx context.Context, k []byte, v []byte, t time.Time) error // ForEachLogEntry iterates through all the log entries at key k and applies the function fn for each record. ForEachLogEntry(ctx context.Context, k []byte, opts FindOptions, fn func(v []byte, t time.Time) error) error // FirstLogEntry is used to retrieve the first entry in the log at key k. FirstLogEntry(ctx context.Context, k []byte) ([]byte, time.Time, error) // LastLogEntry is used to retrieve the last entry in the log at key k. LastLogEntry(ctx context.Context, k []byte) ([]byte, time.Time, error) }
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 ¶
type Label struct { ID platform.ID `json:"id,omitempty"` OrgID platform.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.
type LabelFilter ¶
LabelFilter represents a set of filters that restrict the returned results.
type LabelMapping ¶
type LabelMapping struct { LabelID platform.ID `json:"labelID"` ResourceID platform.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 ¶
func (l *LabelMapping) Validate() error
Validate returns an error if the mapping is invalid.
type LabelMappingFilter ¶
type LabelMappingFilter struct { ResourceID platform.ID ResourceType }
LabelMappingFilter represents a set of filters that restrict the returned results.
type LabelService ¶
type LabelService interface { // FindLabelByID a single label by ID. FindLabelByID(ctx context.Context, id platform.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 platform.ID, upd LabelUpdate) (*Label, error) // DeleteLabel deletes a label DeleteLabel(ctx context.Context, id platform.ID) error // DeleteLabelMapping deletes a label mapping DeleteLabelMapping(ctx context.Context, m *LabelMapping) error }
LabelService represents a service for managing resource labels
type LabelUpdate ¶
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 ¶
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 Limit ¶
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 ¶
type LinePlusSingleStatProperties struct { Queries []DashboardQuery `json:"queries"` Axes map[string]Axis `json:"axes"` Type string `json:"type"` StaticLegend StaticLegend `json:"staticLegend"` 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"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YColumn string `json:"yColumn"` GenerateYAxisTicks []string `json:"generateYAxisTicks"` YTotalTicks int `json:"yTotalTicks"` YTickStart float64 `json:"yTickStart"` YTickStep float64 `json:"yTickStep"` ShadeBelow bool `json:"shadeBelow"` Position string `json:"position"` TimeFormat string `json:"timeFormat"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
LinePlusSingleStatProperties represents options for line plus single stat view in Chronograf
func (LinePlusSingleStatProperties) GetType ¶
func (v LinePlusSingleStatProperties) GetType() string
type LogColumnSetting ¶
type LogColumnSetting struct { Type string `json:"type"` Value string `json:"value"` Name string `json:"name,omitempty"` }
LogColumnSetting represent the settings for a specific column of a Log Viewer.
type LogViewProperties ¶
type LogViewProperties struct { Type string `json:"type"` Columns []LogViewerColumn `json:"columns"` }
LogViewProperties represents options for log viewer in Chronograf.
func (LogViewProperties) GetType ¶
func (v LogViewProperties) GetType() string
type LogViewerColumn ¶
type LogViewerColumn struct { Name string `json:"name"` Position int32 `json:"position"` Settings []LogColumnSetting `json:"settings"` }
LogViewerColumn represents a specific column in a Log Viewer.
type LookupService ¶
type LookupService interface { // FindResourceName returns the name for the resource and ID. FindResourceName(ctx context.Context, resource ResourceType, id platform.ID) (string, error) }
LookupService provides field lookup for the resource and ID.
type Manifest ¶
type Manifest struct { KV ManifestKVEntry `json:"kv"` Files []ManifestEntry `json:"files"` }
Manifest lists the KV and shard file information contained in the backup.
type ManifestEntry ¶
type ManifestEntry struct { OrganizationID string `json:"organizationID"` OrganizationName string `json:"organizationName"` BucketID string `json:"bucketID"` BucketName string `json:"bucketName"` ShardID uint64 `json:"shardID"` FileName string `json:"fileName"` Size int64 `json:"size"` LastModified time.Time `json:"lastModified"` }
ManifestEntry contains the data information for a backed up shard.
type ManifestKVEntry ¶
ManifestKVEntry contains the KV store information for a backup.
type MappingType ¶
type MappingType uint8
func (MappingType) MarshalJSON ¶
func (mt MappingType) MarshalJSON() ([]byte, error)
func (MappingType) String ¶
func (mt MappingType) String() string
func (*MappingType) UnmarshalJSON ¶
func (mt *MappingType) UnmarshalJSON(b []byte) error
func (MappingType) Valid ¶
func (mt MappingType) Valid() error
type MarkdownViewProperties ¶
func (MarkdownViewProperties) GetType ¶
func (v MarkdownViewProperties) GetType() string
type MeasurementSchema ¶ added in v2.1.0
type MeasurementSchema struct { ID influxid.ID `json:"id,omitempty"` OrgID influxid.ID `json:"orgID"` BucketID influxid.ID `json:"bucketID"` Name string `json:"name"` Columns []MeasurementSchemaColumn `json:"columns"` CRUDLog }
func (*MeasurementSchema) Validate ¶ added in v2.1.0
func (m *MeasurementSchema) Validate() error
type MeasurementSchemaColumn ¶ added in v2.1.0
type MeasurementSchemaColumn struct { Name string `json:"name"` Type SemanticColumnType `json:"type"` DataType *SchemaColumnDataType `json:"dataType,omitempty"` }
type MosaicViewProperties ¶
type MosaicViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` ViewColors []string `json:"colors"` FillColumns []string `json:"fillColumns"` XColumn string `json:"xColumn"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YLabelColumnSeparator string `json:"yLabelColumnSeparator"` YLabelColumns []string `json:"yLabelColumns"` 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"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
MosaicViewProperties represents options for mosaic view in Chronograf
func (MosaicViewProperties) GetType ¶
func (v MosaicViewProperties) GetType() string
type Notebook ¶ added in v2.1.0
type Notebook struct { OrgID platform.ID `json:"orgID" db:"org_id"` ID platform.ID `json:"id" db:"id"` Name string `json:"name" db:"name"` Spec NotebookSpec `json:"spec" db:"spec"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` }
Notebook represents all visual and query data for a notebook.
type NotebookListFilter ¶ added in v2.1.0
NotebookListFilter is a selection filter for listing notebooks.
type NotebookReqBody ¶ added in v2.1.0
type NotebookReqBody struct { OrgID platform.ID `json:"orgID"` Name string `json:"name"` Spec NotebookSpec `json:"spec"` }
NotebookReqBody contains fields for creating or updating notebooks.
func (NotebookReqBody) Validate ¶ added in v2.1.0
func (n NotebookReqBody) Validate() error
Validate validates the creation object
type NotebookService ¶ added in v2.1.0
type NotebookService interface { GetNotebook(ctx context.Context, id platform.ID) (*Notebook, error) CreateNotebook(ctx context.Context, create *NotebookReqBody) (*Notebook, error) UpdateNotebook(ctx context.Context, id platform.ID, update *NotebookReqBody) (*Notebook, error) DeleteNotebook(ctx context.Context, id platform.ID) error ListNotebooks(ctx context.Context, filter NotebookListFilter) ([]*Notebook, error) }
NotebookService is the service contract for Notebooks.
type NotebookSpec ¶ added in v2.1.0
type NotebookSpec map[string]interface{}
NotebookSpec is an abitrary JSON object provided by the client.
func (*NotebookSpec) Scan ¶ added in v2.1.0
func (s *NotebookSpec) Scan(value interface{}) error
Scan implements the database/sql Scanner interface for retrieving NotebookSpecs from the database.
type NotificationEndpoint ¶
type NotificationEndpoint interface { Valid() error Type() string json.Marshaler CRUDLogSetter SetID(id platform.ID) SetOrgID(id platform.ID) SetName(name string) SetDescription(description string) SetStatus(status Status) GetID() platform.ID GetCRUDLog() CRUDLog GetOrgID() platform.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 ¶
type NotificationEndpointFilter struct { ID *platform.ID OrgID *platform.ID Org *string UserResourceMappingFilter }
NotificationEndpointFilter represents a set of filter that restrict the returned notification endpoints.
func (NotificationEndpointFilter) QueryParams ¶
func (f NotificationEndpointFilter) QueryParams() map[string][]string
QueryParams Converts NotificationEndpointFilter fields to url query params.
type NotificationEndpointService ¶
type NotificationEndpointService interface { // FindNotificationEndpointByID returns a single notification endpoint by ID. FindNotificationEndpointByID(ctx context.Context, id platform.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 platform.ID) error // UpdateNotificationEndpoint updates a single notification endpoint. // Returns the new notification endpoint after update. UpdateNotificationEndpoint(ctx context.Context, id platform.ID, nr NotificationEndpoint, userID platform.ID) (NotificationEndpoint, error) // PatchNotificationEndpoint updates a single notification endpoint with changeset. // Returns the new notification endpoint state after update. PatchNotificationEndpoint(ctx context.Context, id platform.ID, upd NotificationEndpointUpdate) (NotificationEndpoint, error) // DeleteNotificationEndpoint removes a notification endpoint by ID, returns secret fields, orgID for further deletion. DeleteNotificationEndpoint(ctx context.Context, id platform.ID) (flds []SecretField, orgID platform.ID, err error) }
NotificationEndpointService represents a service for managing notification endpoints.
type NotificationEndpointUpdate ¶
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 ¶
func (n *NotificationEndpointUpdate) Valid() error
Valid will verify if the NotificationEndpointUpdate is valid.
type NotificationRule ¶
type NotificationRule interface { Valid() error Type() string json.Marshaler CRUDLogSetter SetID(id platform.ID) SetOrgID(id platform.ID) SetName(name string) SetDescription(description string) GetID() platform.ID GetCRUDLog() CRUDLog GetOrgID() platform.ID GetName() string GetDescription() string SetOwnerID(id platform.ID) ClearPrivateData() GetOwnerID() platform.ID SetTaskID(id platform.ID) GetTaskID() platform.ID GetEndpointID() platform.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 ¶
type NotificationRuleCreate struct { NotificationRule Status Status `json:"status"` }
NotificationRuleCreate is the struct providing data to create a Notification Rule.
type NotificationRuleFilter ¶
type NotificationRuleFilter struct { OrgID *platform.ID Organization *string Tags []Tag UserResourceMappingFilter }
NotificationRuleFilter represents a set of filter that restrict the returned notification rules.
func (NotificationRuleFilter) QueryParams ¶
func (f NotificationRuleFilter) QueryParams() map[string][]string
QueryParams Converts NotificationRuleFilter fields to url query params.
type NotificationRuleStore ¶
type NotificationRuleStore interface { // FindNotificationRuleByID returns a single notification rule by ID. FindNotificationRuleByID(ctx context.Context, id platform.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 platform.ID) error // UpdateNotificationRuleUpdateNotificationRule updates a single notification rule. // Returns the new notification rule after update. UpdateNotificationRule(ctx context.Context, id platform.ID, nr NotificationRuleCreate, userID platform.ID) (NotificationRule, error) // PatchNotificationRule updates a single notification rule with changeset. // Returns the new notification rule state after update. PatchNotificationRule(ctx context.Context, id platform.ID, upd NotificationRuleUpdate) (NotificationRule, error) // DeleteNotificationRule removes a notification rule by ID. DeleteNotificationRule(ctx context.Context, id platform.ID) error }
NotificationRuleStore represents a service for managing notification rule.
type NotificationRuleUpdate ¶
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 ¶
func (n *NotificationRuleUpdate) Valid() error
Valid will verify if the NotificationRuleUpdate is valid.
type OnboardingRequest ¶
type OnboardingRequest struct { User string `json:"username"` Password string `json:"password"` Org string `json:"org"` Bucket string `json:"bucket"` RetentionPeriodSeconds int64 `json:"retentionPeriodSeconds,omitempty"` RetentionPeriodDeprecated time.Duration `json:"retentionPeriodHrs,omitempty"` Token string `json:"token,omitempty"` }
OnboardingRequest is the request to setup defaults.
func (*OnboardingRequest) RetentionPeriod ¶
func (r *OnboardingRequest) RetentionPeriod() time.Duration
func (*OnboardingRequest) Valid ¶
func (r *OnboardingRequest) Valid() error
type OnboardingResults ¶
type OnboardingResults struct { User *User `json:"user"` Org *Organization `json:"org"` Bucket *Bucket `json:"bucket"` Auth *Authorization `json:"auth"` }
OnboardingResults is a group of elements required for first run.
type OnboardingService ¶
type OnboardingService interface { // IsOnboarding determine if onboarding request is allowed. IsOnboarding(ctx context.Context) (bool, error) // OnboardInitialUser creates the initial org/user/bucket in the DB. OnboardInitialUser(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error) }
OnboardingService represents a service for the first run.
type OperationLogEntry ¶
type OperationLogEntry struct { Description string `json:"description"` UserID platform.ID `json:"userID,omitempty"` Time time.Time `json:"time,omitempty"` }
OperationLogEntry is a record in an operation log.
type Operator ¶
type Operator int
Operator is an Enum value of operators.
func ToOperator ¶
ToOperator converts a string into its equivalent Operator.
func (Operator) MarshalJSON ¶
MarshalJSON implements json.Marshal interface.
func (*Operator) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
type Organization ¶
type Organization struct { ID platform.ID `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description"` CRUDLog }
Organization is an organization. 🎉
type OrganizationFilter ¶
OrganizationFilter represents a set of filter that restrict the returned results.
type OrganizationOperationLogService ¶
type OrganizationOperationLogService interface { // GetOrganizationOperationLog retrieves the operation log for the org with the provided id. GetOrganizationOperationLog(ctx context.Context, id platform.ID, opts FindOptions) ([]*OperationLogEntry, int, error) }
OrganizationOperationLogService is an interface for retrieving the operation log for an org.
type OrganizationService ¶
type OrganizationService interface { // Returns a single organization by ID. FindOrganizationByID(ctx context.Context, id platform.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 platform.ID, upd OrganizationUpdate) (*Organization, error) // Removes a organization by ID. DeleteOrganization(ctx context.Context, id platform.ID) error }
OrganizationService represents a service for managing organization data.
type OrganizationUpdate ¶
OrganizationUpdate represents updates to a organization. Only fields which are set are updated.
type PagingFilter ¶
type PagingFilter interface { // QueryParams returns a map containing url query params. QueryParams() map[string][]string }
PagingFilter represents a filter containing url query params.
type PagingLinks ¶
type PagingLinks struct { Prev string `json:"prev,omitempty"` Self string `json:"self"` Next string `json:"next,omitempty"` }
PagingLinks represents paging links.
func NewPagingLinks ¶
func NewPagingLinks(basePath string, opts FindOptions, f PagingFilter, num int) *PagingLinks
NewPagingLinks returns a PagingLinks. num is the number of returned results.
type PasswordsService ¶
type PasswordsService interface { // SetPassword overrides the password of a known user. SetPassword(ctx context.Context, userID platform.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 platform.ID, password string) error // CompareAndSetPassword checks the password and if they match // updates to the new password. CompareAndSetPassword(ctx context.Context, userID platform.ID, old, new string) error }
PasswordsService is the service for managing basic auth passwords.
type Permission ¶
Permission defines an action and a resource.
func MePermissions ¶
func MePermissions(userID platform.ID) []Permission
MePermissions is the permission to read/write myself.
func MemberBucketPermission ¶
func MemberBucketPermission(bucketID platform.ID) Permission
MemberPermissions are the default permissions for those who can see a resource.
func MemberPermissions ¶
func MemberPermissions(orgID platform.ID) []Permission
MemberPermissions are the default permissions for those who can see a resource.
func NewGlobalPermission ¶
func NewGlobalPermission(a Action, rt ResourceType) (*Permission, error)
NewGlobalPermission constructs a global permission capable of accessing any resource of type rt.
func NewPermission ¶
func NewPermission(a Action, rt ResourceType, orgID platform.ID) (*Permission, error)
NewPermission returns a permission with provided arguments.
func NewPermissionAtID ¶
func NewPermissionAtID(id platform.ID, a Action, rt ResourceType, orgID platform.ID) (*Permission, error)
NewPermissionAtID creates a permission with the provided arguments.
func NewResourcePermission ¶
func NewResourcePermission(a Action, rt ResourceType, rid platform.ID) (*Permission, error)
NewResourcePermission returns a permission with provided arguments.
func OperPermissions ¶
func OperPermissions() []Permission
OperPermissions are the default permissions for those who setup the application.
func OwnerPermissions ¶
func OwnerPermissions(orgID platform.ID) []Permission
OwnerPermissions are the default permissions for those who own a resource.
func ReadAllPermissions ¶
func ReadAllPermissions() []Permission
ReadAllPermissions represents permission to read all data and metadata. Like OperPermissions, but allows read-only users.
func (Permission) Matches ¶
func (p Permission) Matches(perm Permission) bool
Matches returns whether or not one permission matches the other.
func (Permission) String ¶
func (p Permission) String() string
func (*Permission) Valid ¶
func (p *Permission) Valid() error
Valid checks if there the resource and action provided is known.
type PermissionSet ¶
type PermissionSet []Permission
func (PermissionSet) Allowed ¶
func (ps PermissionSet) Allowed(p Permission) bool
type ReadAnnotation ¶ added in v2.1.0
type ReadAnnotation struct { ID platform.ID `json:"id"` // ID is the annotation's generated id. Summary string `json:"summary"` // Summary is the only field required to annotate an event. Message string `json:"message,omitempty"` // Message provides more details about the event being annotated. Stickers map[string]string `json:"stickers,omitempty"` // Stickers are like tags, but named something obscure to differentiate them from influx tags. They are there to differentiate an annotated event. EndTime string `json:"endTime"` // EndTime is the time of the event being annotated. StartTime string `json:"startTime,omitempty"` // StartTime is the start time of the event being annotated. }
ReadAnnotation defines the simplest form of an annotation to be returned. Essentially, it's AnnotationEvent without stream info.
type ReadAnnotations ¶ added in v2.1.0
type ReadAnnotations map[string][]ReadAnnotation
ReadAnnotations allows annotations to be assigned to a stream.
func (ReadAnnotations) MarshalJSON ¶ added in v2.1.0
func (s ReadAnnotations) MarshalJSON() ([]byte, error)
MarshalJSON allows us to marshal the annotations belonging to a stream properly.
type ReadStream ¶ added in v2.1.0
type ReadStream struct { ID platform.ID `json:"id" db:"id"` // ID is the id of a stream. Name string `json:"stream" db:"name"` // Name is the name of a stream. Description string `json:"description,omitempty" db:"description"` // Description is more information about a stream. CreatedAt time.Time `json:"createdAt" db:"created_at"` // CreatedAt is a timestamp. UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` // UpdatedAt is a timestamp. }
ReadStream defines the returned stream.
type RealTimeGenerator ¶
type RealTimeGenerator struct{}
RealTimeGenerator will generate the real time.
func (RealTimeGenerator) Now ¶
func (g RealTimeGenerator) Now() time.Time
Now returns the current time.
type RemoteConnection ¶ added in v2.2.0
type RemoteConnection struct { ID platform.ID `json:"id" db:"id"` OrgID platform.ID `json:"orgID" db:"org_id"` Name string `json:"name" db:"name"` Description *string `json:"description,omitempty" db:"description"` RemoteURL string `json:"remoteURL" db:"remote_url"` RemoteOrgID *platform.ID `json:"remoteOrgID" db:"remote_org_id"` AllowInsecureTLS bool `json:"allowInsecureTLS" db:"allow_insecure_tls"` }
RemoteConnection contains all info about a remote InfluxDB instance that should be returned to users. Note that the auth token used by the request is *not* included here.
type RemoteConnectionListFilter ¶ added in v2.2.0
RemoteConnectionListFilter is a selection filter for listing remote InfluxDB instances.
type RemoteConnections ¶ added in v2.2.0
type RemoteConnections struct {
Remotes []RemoteConnection `json:"remotes"`
}
RemoteConnections is a collection of metadata about remote InfluxDB instances.
type RenamableField ¶
type RenamableField struct { InternalName string `json:"internalName"` DisplayName string `json:"displayName"` Visible bool `json:"visible"` }
RenamableField is a column/row field in a DashboardView of type Table
type Replication ¶ added in v2.2.0
type Replication struct { ID platform.ID `json:"id" db:"id"` OrgID platform.ID `json:"orgID" db:"org_id"` Name string `json:"name" db:"name"` Description *string `json:"description,omitempty" db:"description"` RemoteID platform.ID `json:"remoteID" db:"remote_id"` LocalBucketID platform.ID `json:"localBucketID" db:"local_bucket_id"` RemoteBucketID *platform.ID `json:"remoteBucketID" db:"remote_bucket_id"` RemoteBucketName string `json:"RemoteBucketName" db:"remote_bucket_name"` MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" db:"max_queue_size_bytes"` CurrentQueueSizeBytes int64 `json:"currentQueueSizeBytes"` RemainingBytesToBeSynced int64 `json:"remainingBytesToBeSynced"` LatestResponseCode *int32 `json:"latestResponseCode,omitempty" db:"latest_response_code"` LatestErrorMessage *string `json:"latestErrorMessage,omitempty" db:"latest_error_message"` DropNonRetryableData bool `json:"dropNonRetryableData" db:"drop_non_retryable_data"` MaxAgeSeconds int64 `json:"maxAgeSeconds" db:"max_age_seconds"` }
Replication contains all info about a replication that should be returned to users.
type ReplicationHTTPConfig ¶ added in v2.2.0
type ReplicationHTTPConfig struct { RemoteURL string `db:"remote_url"` RemoteToken string `db:"remote_api_token"` RemoteOrgID *platform.ID `db:"remote_org_id"` AllowInsecureTLS bool `db:"allow_insecure_tls"` RemoteBucketID *platform.ID `db:"remote_bucket_id"` RemoteBucketName string `db:"remote_bucket_name"` DropNonRetryableData bool `db:"drop_non_retryable_data"` }
ReplicationHTTPConfig contains all info needed by a client to make HTTP requests against the remote bucket targeted by a replication.
type ReplicationListFilter ¶ added in v2.2.0
type ReplicationListFilter struct { OrgID platform.ID Name *string RemoteID *platform.ID LocalBucketID *platform.ID }
ReplicationListFilter is a selection filter for listing replications.
type Replications ¶ added in v2.2.0
type Replications struct {
Replications []Replication `json:"replications"`
}
Replications is a collection of metadata about replications.
type Resource ¶
type Resource struct { Type ResourceType `json:"type"` ID *platform.ID `json:"id,omitempty"` OrgID *platform.ID `json:"orgID,omitempty"` }
Resource is an authorizable resource.
type ResourceType ¶
type ResourceType string
ResourceType is an enum defining all resource types that have a permission model in platform
func (ResourceType) Valid ¶
func (t ResourceType) Valid() (err error)
Valid checks if the resource type is a member of the ResourceType enum.
type RestoreService ¶
type RestoreService interface { // RestoreKVStore restores & replaces metadata database. RestoreKVStore(ctx context.Context, r io.Reader) error // RestoreBucket restores storage metadata for a bucket. // TODO(danmoran): As far as I can tell, dbInfo is typed as a []byte because typing it as // a meta.DatabaseInfo introduces a circular dependency between the root package and `meta`. // We should refactor to make this signature easier to use. It might be easier to wait // until we're ready to delete the 2.0.x restore APIs before refactoring. RestoreBucket(ctx context.Context, id platform.ID, dbInfo []byte) (shardIDMap map[uint64]uint64, err error) // RestoreShard uploads a backup file for a single shard. RestoreShard(ctx context.Context, shardID uint64, r io.Reader) error }
RestoreService represents the data restore functions of InfluxDB.
type RestoredBucketMappings ¶ added in v2.1.0
type RestoredBucketMappings struct { ID platform.ID `json:"id"` Name string `json:"name"` ShardMappings []RestoredShardMapping `json:"shardMappings"` }
type RestoredShardMapping ¶ added in v2.1.0
type RetentionPolicyManifest ¶ added in v2.1.0
type RetentionPolicyManifest struct { Name string `json:"name"` ReplicaN int `json:"replicaN"` Duration time.Duration `json:"duration"` ShardGroupDuration time.Duration `json:"shardGroupDuration"` ShardGroups []ShardGroupManifest `json:"shardGroups"` Subscriptions []SubscriptionManifest `json:"subscriptions"` }
type ScatterViewProperties ¶
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"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YColumn string `json:"yColumn"` GenerateYAxisTicks []string `json:"generateYAxisTicks"` YTotalTicks int `json:"yTotalTicks"` YTickStart float64 `json:"yTickStart"` YTickStep float64 `json:"yTickStep"` 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"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
ScatterViewProperties represents options for scatter view in Chronograf
func (ScatterViewProperties) GetType ¶
func (v ScatterViewProperties) GetType() string
type SchemaColumnDataType ¶ added in v2.1.0
type SchemaColumnDataType uint
const ( SchemaColumnDataTypeFloat SchemaColumnDataType = iota SchemaColumnDataTypeInteger SchemaColumnDataTypeUnsigned SchemaColumnDataTypeString SchemaColumnDataTypeBoolean )
func SchemaColumnDataTypeFromString ¶ added in v2.1.0
func SchemaColumnDataTypeFromString(s string) *SchemaColumnDataType
func (SchemaColumnDataType) MarshalJSON ¶ added in v2.1.0
func (s SchemaColumnDataType) MarshalJSON() ([]byte, error)
func (SchemaColumnDataType) Ptr ¶ added in v2.1.0
func (s SchemaColumnDataType) Ptr() *SchemaColumnDataType
Ptr returns a pointer to s.
func (*SchemaColumnDataType) String ¶ added in v2.1.0
func (s *SchemaColumnDataType) String() string
func (SchemaColumnDataType) ToFieldType ¶ added in v2.1.0
func (s SchemaColumnDataType) ToFieldType() models.FieldType
ToFieldType maps SchemaColumnDataType to the equivalent models.FieldType or models.Empty if no such mapping exists.
func (*SchemaColumnDataType) UnmarshalJSON ¶ added in v2.1.0
func (s *SchemaColumnDataType) UnmarshalJSON(d []byte) error
type SchemaType ¶ added in v2.1.0
type SchemaType int
SchemaType differentiates the supported schema for a bucket.
const ( SchemaTypeImplicit SchemaType = iota // SchemaTypeImplicit specifies the bucket has an implicit schema. SchemaTypeExplicit // SchemaTypeExplicit specifies the bucket has an explicit schema. )
func SchemaTypeFromString ¶ added in v2.1.0
func SchemaTypeFromString(s string) *SchemaType
SchemaTypeFromString returns the SchemaType for s or nil if none exists.
func (*SchemaType) Equals ¶ added in v2.1.0
func (s *SchemaType) Equals(other *SchemaType) bool
func (SchemaType) MarshalJSON ¶ added in v2.1.0
func (s SchemaType) MarshalJSON() ([]byte, error)
func (SchemaType) Ptr ¶ added in v2.1.0
func (s SchemaType) Ptr() *SchemaType
Ptr returns a pointer to s.
func (*SchemaType) String ¶ added in v2.1.0
func (s *SchemaType) String() string
func (*SchemaType) UnmarshalJSON ¶ added in v2.1.0
func (s *SchemaType) UnmarshalJSON(d []byte) error
type SchemeV1 ¶
type SchemeV1 string
SchemeV1 is an enumeration of supported authorization types
const ( // SchemeV1Basic indicates the credentials came from an Authorization header using the BASIC scheme SchemeV1Basic SchemeV1 = "basic" // SchemeV1Token indicates the credentials came from an Authorization header using the Token scheme SchemeV1Token SchemeV1 = "token" // SchemeV1URL indicates the credentials came from the u and p query parameters SchemeV1URL SchemeV1 = "url" )
type ScraperTarget ¶
type ScraperTarget struct { ID platform.ID `json:"id,omitempty"` Name string `json:"name"` Type ScraperType `json:"type"` URL string `json:"url"` OrgID platform.ID `json:"orgID,omitempty"` BucketID platform.ID `json:"bucketID,omitempty"` AllowInsecure bool `json:"allowInsecure,omitempty"` }
ScraperTarget is a target to scrape
type ScraperTargetFilter ¶
type ScraperTargetFilter struct { IDs map[platform.ID]bool `json:"ids"` Name *string `json:"name"` OrgID *platform.ID `json:"orgID"` Org *string `json:"org"` }
ScraperTargetFilter represents a set of filter that restrict the returned results.
type ScraperTargetStoreService ¶
type ScraperTargetStoreService interface { ListTargets(ctx context.Context, filter ScraperTargetFilter) ([]ScraperTarget, error) AddTarget(ctx context.Context, t *ScraperTarget, userID platform.ID) error GetTargetByID(ctx context.Context, id platform.ID) (*ScraperTarget, error) RemoveTarget(ctx context.Context, id platform.ID) error UpdateTarget(ctx context.Context, t *ScraperTarget, userID platform.ID) (*ScraperTarget, error) }
ScraperTargetStoreService defines the crud service for ScraperTarget.
type SecretField ¶
SecretField contains a key string, and value pointer.
func (SecretField) MarshalJSON ¶
func (s SecretField) MarshalJSON() ([]byte, error)
MarshalJSON implement the json marshaler interface.
func (SecretField) String ¶
func (s SecretField) String() string
String returns the key of the secret.
func (*SecretField) UnmarshalJSON ¶
func (s *SecretField) UnmarshalJSON(b []byte) error
UnmarshalJSON implement the json unmarshaler interface.
type SecretService ¶
type SecretService interface { // LoadSecret retrieves the secret value v found at key k for organization orgID. LoadSecret(ctx context.Context, orgID platform.ID, k string) (string, error) // GetSecretKeys retrieves all secret keys that are stored for the organization orgID. GetSecretKeys(ctx context.Context, orgID platform.ID) ([]string, error) // PutSecret stores the secret pair (k,v) for the organization orgID. PutSecret(ctx context.Context, orgID platform.ID, k string, v string) error // PutSecrets puts all provided secrets and overwrites any previous values. PutSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error // PatchSecrets patches all provided secrets and updates any previous values. PatchSecrets(ctx context.Context, orgID platform.ID, m map[string]string) error // DeleteSecret removes a single secret from the secret store. DeleteSecret(ctx context.Context, orgID platform.ID, ks ...string) error }
SecretService a service for storing and retrieving secrets.
type SemanticColumnType ¶ added in v2.1.0
type SemanticColumnType int
SemanticColumnType specifies the semantics of a measurement column.
const ( SemanticColumnTypeTimestamp SemanticColumnType = iota // SemanticColumnTypeTimestamp identifies the column is used as the timestamp SemanticColumnTypeTag // SemanticColumnTypeTag identifies the column is used as a tag SemanticColumnTypeField // SemanticColumnTypeField identifies the column is used as a field )
func SemanticColumnTypeFromString ¶ added in v2.1.0
func SemanticColumnTypeFromString(s string) *SemanticColumnType
func (SemanticColumnType) MarshalJSON ¶ added in v2.1.0
func (s SemanticColumnType) MarshalJSON() ([]byte, error)
func (SemanticColumnType) Ptr ¶ added in v2.1.0
func (s SemanticColumnType) Ptr() *SemanticColumnType
func (SemanticColumnType) String ¶ added in v2.1.0
func (s SemanticColumnType) String() string
func (*SemanticColumnType) UnmarshalJSON ¶ added in v2.1.0
func (s *SemanticColumnType) UnmarshalJSON(d []byte) error
type Semaphore ¶
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 ¶
type Session struct { // ID is only required for auditing purposes. ID platform.ID `json:"id"` Key string `json:"key"` CreatedAt time.Time `json:"createdAt"` ExpiresAt time.Time `json:"expiresAt"` UserID platform.ID `json:"userID,omitempty"` Permissions []Permission `json:"permissions,omitempty"` }
Session is a user session.
func (*Session) EphemeralAuth ¶
func (s *Session) EphemeralAuth(orgID platform.ID) *Authorization
EphemeralAuth generates an Authorization that is not stored but at the user's max privs.
func (*Session) Identifier ¶
Identifier returns the sessions ID and is used for auditing.
func (*Session) PermissionSet ¶
func (s *Session) PermissionSet() (PermissionSet, error)
PermissionSet returns the set of permissions associated with the session.
type SessionService ¶
type SessionService interface { FindSession(ctx context.Context, key string) (*Session, error) ExpireSession(ctx context.Context, key string) error CreateSession(ctx context.Context, user string) (*Session, error) // 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 ShardGroupManifest ¶ added in v2.1.0
type ShardGroupManifest struct { ID uint64 `json:"id"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` DeletedAt *time.Time `json:"deletedAt,omitempty"` // use pointer to time.Time so that omitempty works TruncatedAt *time.Time `json:"truncatedAt,omitempty"` // use pointer to time.Time so that omitempty works Shards []ShardManifest `json:"shards"` }
type ShardManifest ¶ added in v2.1.0
type ShardManifest struct { ID uint64 `json:"id"` ShardOwners []ShardOwner `json:"shardOwners"` }
type ShardOwner ¶ added in v2.1.0
type ShardOwner struct {
NodeID uint64 `json:"nodeID"`
}
type SingleStatViewProperties ¶
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 ¶
func (v SingleStatViewProperties) GetType() string
type Source ¶
type Source struct { ID platform.ID `json:"id,omitempty"` // ID is the unique ID of the source OrganizationID platform.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 ¶
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 SourceService ¶
type SourceService interface { // DefaultSource retrieves the default source. DefaultSource(ctx context.Context) (*Source, error) // FindSourceByID retrieves a source by its ID. FindSourceByID(ctx context.Context, id platform.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 platform.ID, upd SourceUpdate) (*Source, error) // DeleteSource removes the source. DeleteSource(ctx context.Context, id platform.ID) error }
SourceService is a service for managing sources.
type SourceUpdate ¶
type SourceUpdate struct { Name *string `json:"name"` Type *SourceType `json:"type,omitempty"` Token *string `json:"token"` URL *string `json:"url"` InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` Telegraf *string `json:"telegraf"` Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` MetaURL *string `json:"metaURL,omitempty"` Role *string `json:"role,omitempty"` DefaultRP *string `json:"defaultRP"` }
SourceUpdate represents updates to a source.
func (SourceUpdate) Apply ¶
func (u SourceUpdate) Apply(s *Source) error
Apply applies an update to a source.
type SqlBackupRestoreService ¶ added in v2.1.0
type SqlBackupRestoreService interface { // BackupSqlStore creates a live backup copy of the sqlite database. BackupSqlStore(ctx context.Context, w io.Writer) error // RestoreSqlStore restores & replaces the sqlite database. RestoreSqlStore(ctx context.Context, r io.Reader) error // RLockSqlStore takes a read lock on the database RLockSqlStore() // RUnlockSqlStore releases a previously-taken read lock on the database. RUnlockSqlStore() }
SqlBackupRestoreService represents the backup and restore functions for the sqlite database.
type StaticLegend ¶ added in v2.1.0
type StaticLegend struct { ColorizeRows bool `json:"colorizeRows,omitempty"` HeightRatio float64 `json:"heightRatio,omitempty"` Show bool `json:"show,omitempty"` Opacity float64 `json:"opacity,omitempty"` OrientationThreshold int `json:"orientationThreshold,omitempty"` ValueAxis string `json:"valueAxis,omitempty"` WidthRatio float64 `json:"widthRatio,omitempty"` }
StaticLegend represents the options specific to the static legend
type StoredAnnotation ¶ added in v2.1.0
type StoredAnnotation struct { ID platform.ID `db:"id"` // ID is the annotation's id. OrgID platform.ID `db:"org_id"` // OrgID is the annotations's owning organization. StreamID platform.ID `db:"stream_id"` // StreamID is the id of a stream. StreamTag string `db:"stream"` // StreamTag is the name of a stream (when selecting with join of streams). Summary string `db:"summary"` // Summary is the summary of the annotated event. Message string `db:"message"` // Message is a longer description of the annotated event. Stickers AnnotationStickers `db:"stickers"` // Stickers are additional labels to group annotations by. Duration string `db:"duration"` // Duration is the time range (with zone) of an annotated event. Lower string `db:"lower"` // Lower is the time an annotated event begins. Upper string `db:"upper"` // Upper is the time an annotated event ends. }
StoredAnnotation represents annotation data to be stored in the database.
func (StoredAnnotation) ToCreate ¶ added in v2.1.0
func (s StoredAnnotation) ToCreate() (*AnnotationCreate, error)
ToCreate is a utility method for converting a StoredAnnotation to an AnnotationCreate type
func (StoredAnnotation) ToEvent ¶ added in v2.1.0
func (s StoredAnnotation) ToEvent() (*AnnotationEvent, error)
ToEvent is a utility method for converting a StoredAnnotation to an AnnotationEvent type
type StoredStream ¶ added in v2.1.0
type StoredStream struct { ID platform.ID `db:"id"` // ID is the stream's id. OrgID platform.ID `db:"org_id"` // OrgID is the stream's owning organization. Name string `db:"name"` // Name is the name of a stream. Description string `db:"description"` // Description is more information about a stream. CreatedAt time.Time `db:"created_at"` // CreatedAt is a timestamp. UpdatedAt time.Time `db:"updated_at"` // UpdatedAt is a timestamp. }
StoredStream represents stream data to be stored in the metadata database.
type Stream ¶ added in v2.1.0
type Stream struct { Name string `json:"stream"` // Name is the name of a stream. Description string `json:"description,omitempty"` // Description is more information about a stream. }
Stream defines the stream metadata. Used in create and update requests/responses. Delete requests will only require stream name.
type StreamListFilter ¶ added in v2.1.0
type StreamListFilter struct { StreamIncludes []string `json:"streamIncludes,omitempty"` // StreamIncludes allows the user to filter streams returned. BasicFilter }
StreamListFilter is a selection filter for listing streams. Streams are not considered first class resources, but depend on an annotation using them.
type SubscriptionManifest ¶ added in v2.1.0
type TableOptions ¶
type TableOptions struct { VerticalTimeAxis bool `json:"verticalTimeAxis"` SortBy RenamableField `json:"sortBy"` Wrapping string `json:"wrapping"` FixFirstColumn bool `json:"fixFirstColumn"` }
TableOptions is a type of options for a DashboardView with type Table
type TableViewProperties ¶
type TableViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` ViewColors []ViewColor `json:"colors"` TableOptions TableOptions `json:"tableOptions"` FieldOptions []RenamableField `json:"fieldOptions"` TimeFormat string `json:"timeFormat"` DecimalPlaces DecimalPlaces `json:"decimalPlaces"` Note string `json:"note"` ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` }
TableViewProperties represents options for table view in Chronograf
func (TableViewProperties) GetType ¶
func (v TableViewProperties) GetType() string
type Tag ¶
Tag is a tag key-value pair.
func (*Tag) QueryParam ¶
QueryParam converts a Tag to a string query parameter
type TelegrafConfig ¶
type TelegrafConfig struct { ID platform.ID `json:"id,omitempty"` // ID of this config object. OrgID platform.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 ¶
func (tc *TelegrafConfig) CountPlugins() map[string]float64
CountPlugins returns a map of the number of times each plugin is used.
func (*TelegrafConfig) UnmarshalJSON ¶
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 ¶
TelegrafConfigFilter represents a set of filter that restrict the returned telegraf configs.
type TelegrafConfigStore ¶
type TelegrafConfigStore interface { // FindTelegrafConfigByID returns a single telegraf config by ID. FindTelegrafConfigByID(ctx context.Context, id platform.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 platform.ID) error // UpdateTelegrafConfig updates a single telegraf config. // Returns the new telegraf config after update. UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *TelegrafConfig, userID platform.ID) (*TelegrafConfig, error) // DeleteTelegrafConfig removes a telegraf config by ID. DeleteTelegrafConfig(ctx context.Context, id platform.ID) error }
TelegrafConfigStore represents a service for managing telegraf config data.
type TimeGenerator ¶
TimeGenerator represents a generator for now.
type TokenGenerator ¶
TokenGenerator represents a generator for API tokens.
type TrackedReplication ¶ added in v2.2.0
type TrackedReplication struct { MaxQueueSizeBytes int64 MaxAgeSeconds int64 OrgID platform.ID LocalBucketID platform.ID }
TrackedReplication defines a replication stream which is currently being tracked via sqlite.
type UpdateRemoteConnectionRequest ¶ added in v2.2.0
type UpdateRemoteConnectionRequest struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` RemoteURL *string `json:"remoteURL,omitempty"` RemoteToken *string `json:"remoteAPIToken,omitempty"` RemoteOrgID *platform.ID `json:"remoteOrgID,omitempty"` AllowInsecureTLS *bool `json:"allowInsecureTLS,omitempty"` }
UpdateRemoteConnectionRequest contains a partial update to existing info about a remote InfluxDB instance.
type UpdateReplicationRequest ¶ added in v2.2.0
type UpdateReplicationRequest struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` RemoteID *platform.ID `json:"remoteID,omitempty"` RemoteBucketID *platform.ID `json:"remoteBucketID,omitempty"` RemoteBucketName *string `json:"remoteBucketName,omitempty"` MaxQueueSizeBytes *int64 `json:"maxQueueSizeBytes,omitempty"` DropNonRetryableData *bool `json:"dropNonRetryableData,omitempty"` MaxAgeSeconds *int64 `json:"maxAgeSeconds,omitempty"` }
UpdateReplicationRequest contains a partial update to existing info about a replication.
func (*UpdateReplicationRequest) OK ¶ added in v2.2.0
func (r *UpdateReplicationRequest) OK() error
type Usage ¶
type Usage struct { OrganizationID *platform.ID `json:"organizationID,omitempty"` BucketID *platform.ID `json:"bucketID,omitempty"` Type UsageMetric `json:"type"` Value float64 `json:"value"` }
Usage is a metric associated with the utilization of a particular resource.
type UsageFilter ¶
UsageFilter is used to filter usage.
type UsageMetric ¶
type UsageMetric string
UsageMetric used to track classes of usage.
const ( // UsageWriteRequestCount is the name of the metrics for tracking write request count. UsageWriteRequestCount UsageMetric = "usage_write_request_count" // UsageWriteRequestBytes is the name of the metrics for tracking the number of write bytes. UsageWriteRequestBytes UsageMetric = "usage_write_request_bytes" // UsageValues is the name of the metrics for tracking the number of values. UsageValues UsageMetric = "usage_values" // UsageSeries is the name of the metrics for tracking the number of series written. UsageSeries UsageMetric = "usage_series" // UsageQueryRequestCount is the name of the metrics for tracking query request count. UsageQueryRequestCount UsageMetric = "usage_query_request_count" // UsageQueryRequestBytes is the name of the metrics for tracking the number of query bytes. UsageQueryRequestBytes UsageMetric = "usage_query_request_bytes" )
type UsageService ¶
type UsageService interface {
GetUsage(ctx context.Context, filter UsageFilter) (map[UsageMetric]*Usage, error)
}
UsageService is a service for accessing usage statistics.
type User ¶
type User struct { ID platform.ID `json:"id,omitempty"` Name string `json:"name"` OAuthID string `json:"oauthID,omitempty"` Status Status `json:"status"` }
User is a user. 🎉
type UserFilter ¶
UserFilter represents a set of filter that restrict the returned results.
type UserOperationLogService ¶
type UserOperationLogService interface { // GetUserOperationLog retrieves the operation log for the user with the provided id. GetUserOperationLog(ctx context.Context, id platform.ID, opts FindOptions) ([]*OperationLogEntry, int, error) }
UserOperationLogService is an interface for retrieving the operation log for a user.
type UserResourceMapping ¶
type UserResourceMapping struct { UserID platform.ID `json:"userID"` UserType UserType `json:"userType"` MappingType MappingType `json:"mappingType"` ResourceType ResourceType `json:"resourceType"` ResourceID platform.ID `json:"resourceID"` }
UserResourceMapping represents a mapping of a resource to its user.
func (*UserResourceMapping) ToPermissions ¶
func (m *UserResourceMapping) ToPermissions() ([]Permission, error)
ToPermissions converts a user resource mapping into a set of permissions.
func (UserResourceMapping) Validate ¶
func (m UserResourceMapping) Validate() error
Validate reports any validation errors for the mapping.
type UserResourceMappingFilter ¶
type UserResourceMappingFilter struct { ResourceID platform.ID ResourceType ResourceType UserID platform.ID UserType UserType }
UserResourceMappingFilter represents a set of filters that restrict the returned results.
type UserResourceMappingService ¶
type UserResourceMappingService interface { // FindUserResourceMappings returns a list of UserResourceMappings that match filter and the total count of matching mappings. FindUserResourceMappings(ctx context.Context, filter UserResourceMappingFilter, opt ...FindOptions) ([]*UserResourceMapping, int, error) // CreateUserResourceMapping creates a user resource mapping. CreateUserResourceMapping(ctx context.Context, m *UserResourceMapping) error // DeleteUserResourceMapping deletes a user resource mapping. DeleteUserResourceMapping(ctx context.Context, resourceID, userID platform.ID) error }
UserResourceMappingService maps the relationships between users and resources.
type UserResponse ¶ added in v2.2.0
UserResponse is the response of user
type UserService ¶
type UserService interface { // Returns a single user by ID. FindUserByID(ctx context.Context, id platform.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 platform.ID, upd UserUpdate) (*User, error) // Removes a user by ID. DeleteUser(ctx context.Context, id platform.ID) error // FindPermissionForUser FindPermissionForUser(ctx context.Context, UserID platform.ID) (PermissionSet, error) }
UserService represents a service for managing user data.
type UserUpdate ¶
UserUpdate represents updates to a user. Only fields which are set are updated.
type V1SourceFields ¶
type V1SourceFields struct { Username string `json:"username,omitempty"` // Username is the username to connect to the source Password string `json:"password,omitempty"` // Password is in CLEARTEXT MetaURL string `json:"metaUrl,omitempty"` // MetaURL is the url for the meta node DefaultRP string `json:"defaultRP"` // DefaultRP is the default retention policy used in database queries to this source }
V1SourceFields are the fields for connecting to a 1.0 source (oss or enterprise)
type Variable ¶
type Variable struct { ID platform.ID `json:"id,omitempty"` OrganizationID platform.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
type VariableArguments ¶
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 ¶
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 ¶
type VariableConstantValues []string
VariableConstantValues are the data for expanding a constants-based Variable
type VariableFilter ¶
VariableFilter represents a set of filter that restrict the returned results.
func (VariableFilter) QueryParams ¶
func (f VariableFilter) QueryParams() map[string][]string
QueryParams implements PagingFilter.
It converts VariableFilter fields to url query params.
type VariableMapValues ¶
VariableMapValues are the data for expanding a map-based Variable
type VariableQueryValues ¶
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 ¶
type VariableService interface { // FindVariableByID finds a single variable from the store by its ID FindVariableByID(ctx context.Context, id platform.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 platform.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 platform.ID) error }
VariableService describes a service for managing Variables
type VariableUpdate ¶
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 ¶
func (u *VariableUpdate) Apply(m *Variable)
Apply applies non-zero fields from a VariableUpdate to a Variable
func (*VariableUpdate) Valid ¶
func (u *VariableUpdate) Valid() error
Valid returns an error if a Variable changeset is not valid
type View ¶
type View struct { ViewContents Properties ViewProperties }
View holds positional and visual information for a View.
func (View) MarshalJSON ¶
MarshalJSON encodes a view to JSON bytes.
func (*View) UnmarshalJSON ¶
UnmarshalJSON decodes JSON bytes into the corresponding view type (those that implement ViewProperties).
type ViewColor ¶
type ViewColor struct { ID string `json:"id"` // ID is the unique id of the View color Type string `json:"type"` // Type is how the color is used. Accepted (min,max,threshold) Hex string `json:"hex"` // Hex is the hex number of the color Name string `json:"name"` // Name is the user-facing name of the hex color Value float64 `json:"value"` // Value is the data value mapped to this color }
ViewColor represents the encoding of data into visualizations
type ViewContents ¶
ViewContents is the id and name of a specific view.
type ViewContentsUpdate ¶
type ViewContentsUpdate struct {
Name *string `json:"name"`
}
ViewContentsUpdate is a struct for updating the non properties content of a View.
type ViewFilter ¶
ViewFilter represents a set of filter that restrict the returned results.
type ViewProperties ¶
type ViewProperties interface { GetType() string // contains filtered or unexported methods }
ViewProperties is used to mark other structures as conforming to a View.
func UnmarshalViewPropertiesJSON ¶
func UnmarshalViewPropertiesJSON(b []byte) (ViewProperties, error)
UnmarshalViewPropertiesJSON unmarshals JSON bytes into a ViewProperties.
type ViewUpdate ¶
type ViewUpdate struct { ViewContentsUpdate Properties ViewProperties }
ViewUpdate is a struct for updating Views.
func (ViewUpdate) Apply ¶
func (u ViewUpdate) Apply(v *View) error
Apply updates a view with the view updates properties.
func (ViewUpdate) MarshalJSON ¶
func (u ViewUpdate) MarshalJSON() ([]byte, error)
MarshalJSON encodes a view to JSON bytes.
func (*ViewUpdate) UnmarshalJSON ¶
func (u *ViewUpdate) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes JSON bytes into the corresponding view update type (those that implement ViewProperties).
func (ViewUpdate) Valid ¶
func (u ViewUpdate) Valid() *errors.Error
Valid validates the update struct. It expects minimal values to be set.
type WriteService ¶
type WriteService interface {
WriteTo(ctx context.Context, filter BucketFilter, r io.Reader) error
}
WriteService writes data read from the reader.
type XYViewProperties ¶
type XYViewProperties struct { Queries []DashboardQuery `json:"queries"` Axes map[string]Axis `json:"axes"` Type string `json:"type"` StaticLegend StaticLegend `json:"staticLegend"` 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"` GenerateXAxisTicks []string `json:"generateXAxisTicks"` XTotalTicks int `json:"xTotalTicks"` XTickStart float64 `json:"xTickStart"` XTickStep float64 `json:"xTickStep"` YColumn string `json:"yColumn"` GenerateYAxisTicks []string `json:"generateYAxisTicks"` YTotalTicks int `json:"yTotalTicks"` YTickStart float64 `json:"yTickStart"` YTickStep float64 `json:"yTickStep"` ShadeBelow bool `json:"shadeBelow"` Position string `json:"position"` TimeFormat string `json:"timeFormat"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` }
XYViewProperties represents options for line, bar, step, or stacked view in Chronograf
func (XYViewProperties) GetType ¶
func (v XYViewProperties) GetType() string
Source Files ¶
- annotation.go
- auth.go
- authz.go
- backup.go
- bucket.go
- build.go
- check.go
- credentials.go
- crud_log.go
- dashboard.go
- dbrp_mapping.go
- delete.go
- document.go
- duration.go
- keyvalue_log.go
- label.go
- lookup.go
- measurement.go
- measurement_schema.go
- measurement_schema_errors.go
- notebook.go
- notification.go
- notification_endpoint.go
- onboarding.go
- operation_log.go
- organization.go
- paging.go
- passwords.go
- remote_connection.go
- replication.go
- scraper.go
- secret.go
- semaphore.go
- session.go
- source.go
- status.go
- tag.go
- telegraf.go
- token.go
- usage.go
- user.go
- user_resource_mapping.go
- variable.go
- write.go
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
influxd/inspect/report_tsi
Package report_tsi provides a report about the series cardinality in one or more TSI indexes.
|
Package report_tsi provides a report about the series cardinality in one or more TSI indexes. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
This package imports all the influxdb-specific query builtins.
|
This package imports all the influxdb-specific query builtins. |
static
The fluxinit/static package can be imported in test cases and other uses cases where it is okay to always initialize flux.
|
The fluxinit/static package can be imported in test cases and other uses cases where it is okay to always initialize flux. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
query/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
query/neldermead
Package neldermead is an implementation of the Nelder-Mead optimization method.
|
Package neldermead is an implementation of the Nelder-Mead optimization method. |
kit
|
|
check
Package check standardizes /health and /ready endpoints.
|
Package check standardizes /health and /ready endpoints. |
cli
Package cli creates simple CLI options with ENV overrides using viper.
|
Package cli creates simple CLI options with ENV overrides using viper. |
feature
Package feature provides feature flagging capabilities for InfluxDB servers.
|
Package feature provides feature flagging capabilities for InfluxDB servers. |
prom
Package prom provides a wrapper around a prometheus metrics registry so that all services are unified in how they expose prometheus metrics.
|
Package prom provides a wrapper around a prometheus metrics registry so that all services are unified in how they expose prometheus metrics. |
prom/promtest
Package promtest provides helpers for parsing and extracting prometheus metrics.
|
Package promtest provides helpers for parsing and extracting prometheus metrics. |
package kv
|
package kv |
migration
package migration
|
package migration |
migration/all
package all
|
package all |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package models implements basic objects used throughout the TICK stack.
|
Package models implements basic objects used throughout the TICK stack. |
pkg
|
|
cmputil
Package cmputil provides helper utilities for the go-cmp package.
|
Package cmputil provides helper utilities for the go-cmp package. |
deep
Package deep provides a deep equality check for use in tests.
|
Package deep provides a deep equality check for use in tests. |
encoding/simple8b
Package simple8b implements the 64bit integer encoding algorithm as published by Ann and Moffat in "Index compression using 64-bit words", Softw.
|
Package simple8b implements the 64bit integer encoding algorithm as published by Ann and Moffat in "Index compression using 64-bit words", Softw. |
escape
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.
|
Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol. |
estimator/hll
Package hll contains a HyperLogLog++ with a LogLog-Beta bias correction implementation that is adapted (mostly copied) from an implementation provided by Clark DuVall github.com/clarkduvall/hyperloglog.
|
Package hll contains a HyperLogLog++ with a LogLog-Beta bias correction implementation that is adapted (mostly copied) from an implementation provided by Clark DuVall github.com/clarkduvall/hyperloglog. |
limiter
Package limiter provides concurrency limiters.
|
Package limiter provides concurrency limiters. |
metrics
Package metrics provides various measurements that are safe for concurrent access.
|
Package metrics provides various measurements that are safe for concurrent access. |
mmap
Package mmap provides a way to memory-map a file.
|
Package mmap provides a way to memory-map a file. |
pointer
Package pointer provides utilities for pointer handling that aren't available in go.
|
Package pointer provides utilities for pointer handling that aren't available in go. |
pool
Package pool provides pool structures to help reduce garbage collector pressure.
|
Package pool provides pool structures to help reduce garbage collector pressure. |
reporthelper
Package reporthelper reports statistics about TSM files.
|
Package reporthelper reports statistics about TSM files. |
slices
Package slices contains functions to operate on slices treated as sets.
|
Package slices contains functions to operate on slices treated as sets. |
testing/assert
Package assert provides helper functions that can be used with the standard Go testing package.
|
Package assert provides helper functions that can be used with the standard Go testing package. |
tracing
Package tracing provides a way for capturing hierarchical traces.
|
Package tracing provides a way for capturing hierarchical traces. |
tracing/wire
Package wire is used to serialize a trace.
|
Package wire is used to serialize a trace. |
Package pkger implements a means to create and consume reusable templates for what will eventually come to support all influxdb resources.
|
Package pkger implements a means to create and consume reusable templates for what will eventually come to support all influxdb resources. |
control
Package control keeps track of resources and manages queries.
|
Package control keeps track of resources and manages queries. |
fluxlang
Package language exposes the flux parser as an interface.
|
Package language exposes the flux parser as an interface. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package resource defines an interface for recording changes to InfluxDB resources.
|
Package resource defines an interface for recording changes to InfluxDB resources. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
task
|
|
backend/executor/mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock contains mock implementations of different task interfaces.
|
Package mock contains mock implementations of different task interfaces. |
options
Package options provides ways to extract the task-related options from a Flux script.
|
Package options provides ways to extract the task-related options from a Flux script. |
servicetest
Package servicetest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of influxdb.TaskService.
|
Package servicetest provides tests to ensure that implementations of platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of influxdb.TaskService. |
The tenant domain encapsulates all the storage critical metadata services: User Organization Bucket URM's
|
The tenant domain encapsulates all the storage critical metadata services: User Organization Bucket URM's |
Package tests contains a set of integration tests, which run in-memory versions of various 2.0 services.
|
Package tests contains a set of integration tests, which run in-memory versions of various 2.0 services. |
Package toml adds support to marshal and unmarshal types not in the official TOML spec.
|
Package toml adds support to marshal and unmarshal types not in the official TOML spec. |
tools
|
|
cursors/mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
engine
Package engine can be imported to initialize and register all available TSDB engines.
|
Package engine can be imported to initialize and register all available TSDB engines. |
engine/tsm1
Package tsm1 provides a TSDB in the Time Structured Merge tree format.
|
Package tsm1 provides a TSDB in the Time Structured Merge tree format. |
index/tsi1
Package tsi1 provides a memory-mapped index implementation that supports high cardinality series.
|
Package tsi1 provides a memory-mapped index implementation that supports high cardinality series. |
Package uuid provides functions to create time-based UUIDs.
|
Package uuid provides functions to create time-based UUIDs. |
authorization/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
coordinator
Package coordinator contains abstractions for writing points, executing statements, and accessing meta data.
|
Package coordinator contains abstractions for writing points, executing statements, and accessing meta data. |
services/meta
Package meta provides control over meta data for InfluxDB, such as controlling databases, retention policies, users, etc.
|
Package meta provides control over meta data for InfluxDB, such as controlling databases, retention policies, users, etc. |
services/precreator
Package precreator provides the shard precreation service.
|
Package precreator provides the shard precreation service. |
services/retention
Package retention provides the retention policy enforcement service.
|
Package retention provides the retention policy enforcement service. |