Documentation ¶
Index ¶
- Constants
- func AddQueryConfig(c *chronograf.DashboardCell)
- func AddQueryConfigs(d chronograf.Dashboard) (newDash chronograf.Dashboard)
- func Assets(opts AssetsOpts) http.Handler
- func AuthorizedToken(auth oauth2.Authenticator, logger chronograf.Logger, next http.Handler) http.HandlerFunc
- func AuthorizedUser(store DataStore, useAuth bool, role string, logger chronograf.Logger, ...) http.HandlerFunc
- func BasicAuthWrapper(router chronograf.Router, auth *basicAuth.BasicAuth) http.Handler
- func CorrectWidthHeight(c *chronograf.DashboardCell)
- func DashboardDefaults(d chronograf.Dashboard) (newDash chronograf.Dashboard)
- func Error(w http.ResponseWriter, code int, msg string, logger chronograf.Logger)
- func FlushingHandler(next http.Handler) http.Handler
- func HasAuthorizedToken(auth oauth2.Authenticator, r *http.Request) (oauth2.Principal, error)
- func HasCorrectAxes(c *chronograf.DashboardCell) error
- func HasCorrectColors(c *chronograf.DashboardCell) error
- func HasCorrectLegend(c *chronograf.DashboardCell) error
- func HasCorrectQueryType(c *chronograf.DashboardCell) error
- func Logger(logger chronograf.Logger, next http.Handler) http.Handler
- func MoveTimeShift(c *chronograf.DashboardCell)
- func NewMux(opts MuxOpts, service Service) http.Handler
- func RawStoreAccess(logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc
- func Redoc(swagger string) http.HandlerFunc
- func RouteMatchesPrincipal(store DataStore, useAuth bool, logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc
- func Spec() http.HandlerFunc
- func ToQueryConfig(query string) chronograf.QueryConfig
- func ValidDashboardCellRequest(c *chronograf.DashboardCell) error
- func ValidDashboardRequest(d *chronograf.Dashboard, defaultOrgID string) error
- func ValidDatabaseRequest(d *chronograf.Database) error
- func ValidInfluxRequest(p chronograf.Query) error
- func ValidRetentionPolicyRequest(rp *chronograf.RetentionPolicy) error
- func ValidRuleRequest(rule chronograf.AlertRule) error
- func ValidSourceRequest(s *chronograf.Source, defaultOrgID string) error
- func ValidTemplateRequest(template *chronograf.Template) error
- func ValidUniqueTemplateVariables(dashboard *chronograf.Dashboard) error
- func ValidateNote(c *chronograf.DashboardCell) error
- func ValidateQueryConfig(q *chronograf.QueryConfig) error
- type ASTRequest
- type ASTResponse
- type AllRoutes
- type AssetsOpts
- type AuthRoute
- type AuthRoutes
- type CustomLink
- type DashboardBuilder
- type DataStore
- type ErrorMessage
- type InfluxClient
- type KapacitorBuilder
- type KapacitorStatus
- type LayoutBuilder
- type MountableRouter
- func (mr *MountableRouter) DELETE(path string, handler http.HandlerFunc)
- func (mr *MountableRouter) GET(path string, handler http.HandlerFunc)
- func (mr *MountableRouter) Handler(method string, path string, handler http.Handler)
- func (mr *MountableRouter) PATCH(path string, handler http.HandlerFunc)
- func (mr *MountableRouter) POST(path string, handler http.HandlerFunc)
- func (mr *MountableRouter) PUT(path string, handler http.HandlerFunc)
- func (mr *MountableRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request)
- type MultiDashboardBuilder
- type MultiKapacitorBuilder
- type MultiLayoutBuilder
- type MultiOrganizationBuilder
- type MultiProtoboardsBuilder
- type MultiSourceBuilder
- type MuxOpts
- type OrganizationBuilder
- type Params
- type ProtoboardsBuilder
- type QueriesRequest
- type QueriesResponse
- type QueryRequest
- type QueryResponse
- type Server
- type Service
- func (s *Service) Annotation(w http.ResponseWriter, r *http.Request)
- func (s *Service) Annotations(w http.ResponseWriter, r *http.Request)
- func (s *Service) AuthConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) Config(w http.ResponseWriter, r *http.Request)
- func (s *Service) DashboardCellID(w http.ResponseWriter, r *http.Request)
- func (s *Service) DashboardCells(w http.ResponseWriter, r *http.Request)
- func (s *Service) DashboardID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Dashboards(w http.ResponseWriter, r *http.Request)
- func (s *Service) DefaultRP(ctx context.Context, qc *chronograf.QueryConfig, src *chronograf.Source) error
- func (h *Service) DropDatabase(w http.ResponseWriter, r *http.Request)
- func (h *Service) DropRetentionPolicy(w http.ResponseWriter, r *http.Request)
- func (s *Service) Environment(w http.ResponseWriter, r *http.Request)
- func (s *Service) Flux(w http.ResponseWriter, r *http.Request)
- func (s *Service) FluxAST(w http.ResponseWriter, r *http.Request)
- func (s *Service) FluxSuggestion(w http.ResponseWriter, r *http.Request)
- func (s *Service) FluxSuggestions(w http.ResponseWriter, r *http.Request)
- func (h *Service) GetDatabases(w http.ResponseWriter, r *http.Request)
- func (s *Service) Influx(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesDelete(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesGet(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesID(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesPost(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesPut(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorRulesStatus(w http.ResponseWriter, r *http.Request)
- func (s *Service) Kapacitors(w http.ResponseWriter, r *http.Request)
- func (s *Service) KapacitorsID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Layouts(w http.ResponseWriter, r *http.Request)
- func (s *Service) LayoutsID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Mappings(w http.ResponseWriter, r *http.Request)
- func (s *Service) Me(w http.ResponseWriter, r *http.Request)
- func (h *Service) Measurements(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewAnnotation(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewDashboard(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewDashboardCell(w http.ResponseWriter, r *http.Request)
- func (h *Service) NewDatabase(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewKapacitor(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewMapping(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewOrganization(w http.ResponseWriter, r *http.Request)
- func (h *Service) NewRetentionPolicy(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewService(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewSource(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewSourceRole(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewSourceUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewTemplate(w http.ResponseWriter, r *http.Request)
- func (s *Service) NewUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) OrganizationConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) OrganizationID(w http.ResponseWriter, r *http.Request)
- func (s *Service) OrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) Organizations(w http.ResponseWriter, r *http.Request)
- func (s *Service) Permissions(w http.ResponseWriter, r *http.Request)
- func (s *Service) Protoboards(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProtoboardsID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Proxy(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProxyDelete(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProxyGet(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProxyPatch(w http.ResponseWriter, r *http.Request)
- func (s *Service) ProxyPost(w http.ResponseWriter, r *http.Request)
- func (s *Service) Queries(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveAnnotation(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveDashboard(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveDashboardCell(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveKapacitor(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveMapping(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveOrganization(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveService(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveSource(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveSourceRole(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveSourceUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveTemplate(w http.ResponseWriter, r *http.Request)
- func (s *Service) RemoveUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) ReplaceAuthConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) ReplaceDashboard(w http.ResponseWriter, r *http.Request)
- func (s *Service) ReplaceDashboardCell(w http.ResponseWriter, r *http.Request)
- func (s *Service) ReplaceOrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) ReplaceTemplate(w http.ResponseWriter, r *http.Request)
- func (h *Service) RetentionPolicies(w http.ResponseWriter, r *http.Request)
- func (s *Service) ServiceID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Services(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourceHealth(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourceRoleID(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourceRoles(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourceUserID(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourceUsers(w http.ResponseWriter, r *http.Request)
- func (s *Service) Sources(w http.ResponseWriter, r *http.Request)
- func (s *Service) SourcesID(w http.ResponseWriter, r *http.Request)
- func (s *Service) TemplateID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Templates(w http.ResponseWriter, r *http.Request)
- func (s *Service) TimeSeries(src chronograf.Source) (chronograf.TimeSeries, error)
- func (s *Service) UpdateAnnotation(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateDashboard(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateKapacitor(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateMapping(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateMe(auth oauth2.Authenticator) func(http.ResponseWriter, *http.Request)
- func (s *Service) UpdateOrganization(w http.ResponseWriter, r *http.Request)
- func (h *Service) UpdateRetentionPolicy(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateService(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateSource(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateSourceRole(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateSourceUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateUser(w http.ResponseWriter, r *http.Request)
- func (s *Service) UserID(w http.ResponseWriter, r *http.Request)
- func (s *Service) Users(w http.ResponseWriter, r *http.Request)
- func (s *Service) ValidateTextTemplate(w http.ResponseWriter, r *http.Request)
- func (s *Service) Write(w http.ResponseWriter, r *http.Request)
- type SourcesBuilder
- type Store
- func (s *Store) Config(ctx context.Context) chronograf.ConfigStore
- func (s *Store) Dashboards(ctx context.Context) chronograf.DashboardsStore
- func (s *Store) Layouts(ctx context.Context) chronograf.LayoutsStore
- func (s *Store) Mappings(ctx context.Context) chronograf.MappingsStore
- func (s *Store) OrganizationConfig(ctx context.Context) chronograf.OrganizationConfigStore
- func (s *Store) Organizations(ctx context.Context) chronograf.OrganizationsStore
- func (s *Store) Protoboards(ctx context.Context) chronograf.ProtoboardsStore
- func (s *Store) Servers(ctx context.Context) chronograf.ServersStore
- func (s *Store) Sources(ctx context.Context) chronograf.SourcesStore
- func (s *Store) Users(ctx context.Context) chronograf.UsersStore
- type SuggestionResponse
- type SuggestionsResponse
- type TimeSeriesClient
- type URLPrefixer
- type ValidTextTemplateRequest
Constants ¶
const ( // DebugDir is the prefix of the assets in development mode DebugDir = "ui/build" // DebugDefault is the default item to load if 404 DebugDefault = "ui/build/index.html" )
const ( // DefaultWidth is used if not specified DefaultWidth = 4 // DefaultHeight is used if not specified DefaultHeight = 4 )
const ChunkSize int = 512
ChunkSize is the number of bytes per chunked transfer-encoding
const (
ErrNotFlusher = "Expected http.ResponseWriter to be an http.Flusher, but wasn't"
)
const (
// JSONType the mimetype for a json request
JSONType = "application/json"
)
const ServerContextKey = serverContextKey("server")
ServerContextKey is the key used to specify that the server is making the requet via context
const UserContextKey = userContextKey("user")
UserContextKey is the context key for retrieving the user off of context
Variables ¶
This section is empty.
Functions ¶
func AddQueryConfig ¶
func AddQueryConfig(c *chronograf.DashboardCell)
AddQueryConfig updates a cell by converting InfluxQL into queryconfigs If influxql cannot be represented by a full query config, then, the query config's raw text is set to the command.
func AddQueryConfigs ¶
func AddQueryConfigs(d chronograf.Dashboard) (newDash chronograf.Dashboard)
AddQueryConfigs updates all the celsl in the dashboard to have query config objects corresponding to their influxql queries.
func Assets ¶
func Assets(opts AssetsOpts) http.Handler
Assets creates a middleware that will serve a single page app.
func AuthorizedToken ¶
func AuthorizedToken(auth oauth2.Authenticator, logger chronograf.Logger, next http.Handler) http.HandlerFunc
AuthorizedToken extracts the token and validates; if valid the next handler will be run. The principal will be sent to the next handler via the request's Context. It is up to the next handler to determine if the principal has access. On failure, will return http.StatusForbidden.
func AuthorizedUser ¶
func AuthorizedUser( store DataStore, useAuth bool, role string, logger chronograf.Logger, next http.HandlerFunc, ) http.HandlerFunc
AuthorizedUser extracts the user name and provider from context. If the user and provider can be found on the context, we look up the user by their name and provider. If the user is found, we verify that the user has at at least the role supplied.
func BasicAuthWrapper ¶
BasicAuthWrapper returns http handlers that wraps the supplied handler with HTTP Basic authentication
func CorrectWidthHeight ¶
func CorrectWidthHeight(c *chronograf.DashboardCell)
CorrectWidthHeight changes the cell to have at least the minimum width and height
func DashboardDefaults ¶
func DashboardDefaults(d chronograf.Dashboard) (newDash chronograf.Dashboard)
DashboardDefaults updates the dashboard with the default values if none are specified
func Error ¶
func Error(w http.ResponseWriter, code int, msg string, logger chronograf.Logger)
Error writes an JSON message
func FlushingHandler ¶
FlushingHandler may not actually do anything, but it was ostensibly implemented to flush response writers that can be flushed for the purposes in the comment above.
func HasAuthorizedToken ¶
HasAuthorizedToken extracts the token from a request and validates it using the authenticator. It is used by routes that need access to the token to populate links request.
func HasCorrectAxes ¶
func HasCorrectAxes(c *chronograf.DashboardCell) error
HasCorrectAxes verifies that only permitted axes exist within a DashboardCell
func HasCorrectColors ¶
func HasCorrectColors(c *chronograf.DashboardCell) error
HasCorrectColors verifies that the format of each color is correct
func HasCorrectLegend ¶
func HasCorrectLegend(c *chronograf.DashboardCell) error
HasCorrectLegend verifies that the format of the legend is correct
func HasCorrectQueryType ¶
func HasCorrectQueryType(c *chronograf.DashboardCell) error
HasCorrectQueryType ensures that all query types have a non-empty value
func MoveTimeShift ¶
func MoveTimeShift(c *chronograf.DashboardCell)
MoveTimeShift moves TimeShift from the QueryConfig to the DashboardQuery
func RawStoreAccess ¶
func RawStoreAccess(logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc
RawStoreAccess gives a super admin access to the data store without a facade.
func Redoc ¶
func Redoc(swagger string) http.HandlerFunc
Redoc serves the swagger JSON using the redoc package.
func RouteMatchesPrincipal ¶
func RouteMatchesPrincipal( store DataStore, useAuth bool, logger chronograf.Logger, next http.HandlerFunc, ) http.HandlerFunc
RouteMatchesPrincipal checks that the organization on context matches the organization in the route.
func ToQueryConfig ¶
func ToQueryConfig(query string) chronograf.QueryConfig
ToQueryConfig converts InfluxQL into queryconfigs If influxql cannot be represented by a full query config, then, the query config's raw text is set to the query.
func ValidDashboardCellRequest ¶
func ValidDashboardCellRequest(c *chronograf.DashboardCell) error
ValidDashboardCellRequest verifies that the dashboard cells have a query and have the correct axes specified
func ValidDashboardRequest ¶
func ValidDashboardRequest(d *chronograf.Dashboard, defaultOrgID string) error
ValidDashboardRequest verifies that the dashboard cells have a query
func ValidDatabaseRequest ¶
func ValidDatabaseRequest(d *chronograf.Database) error
ValidDatabaseRequest checks if the database posted is valid
func ValidInfluxRequest ¶
func ValidInfluxRequest(p chronograf.Query) error
ValidInfluxRequest checks if queries specify a command.
func ValidRetentionPolicyRequest ¶
func ValidRetentionPolicyRequest(rp *chronograf.RetentionPolicy) error
ValidRetentionPolicyRequest checks if a retention policy is valid on POST
func ValidRuleRequest ¶
func ValidRuleRequest(rule chronograf.AlertRule) error
ValidRuleRequest checks if the requested rule change is valid
func ValidSourceRequest ¶
func ValidSourceRequest(s *chronograf.Source, defaultOrgID string) error
ValidSourceRequest checks if name, url, type, and role are valid
func ValidTemplateRequest ¶
func ValidTemplateRequest(template *chronograf.Template) error
ValidTemplateRequest checks if the request sent to the server is the correct format.
func ValidUniqueTemplateVariables ¶
func ValidUniqueTemplateVariables(dashboard *chronograf.Dashboard) error
ValidUniqueTemplateVariables validates that a template defines variable at most once
func ValidateNote ¶
func ValidateNote(c *chronograf.DashboardCell) error
ValidateNote sanitizes note html against XSS attacks and validates note visibility
func ValidateQueryConfig ¶
func ValidateQueryConfig(q *chronograf.QueryConfig) error
ValidateQueryConfig checks any query config input
Types ¶
type ASTRequest ¶
type ASTRequest struct {
Body string `json:"body"`
}
type ASTResponse ¶
type AllRoutes ¶
type AllRoutes struct { GetPrincipal func(r *http.Request) oauth2.Principal // GetPrincipal is used to retrieve the principal on http request. AuthRoutes []AuthRoute // Location of all auth routes. If no auth, this can be empty. LogoutLink string // Location of the logout route for all auth routes. If no auth, this can be empty. StatusFeed string // External link to the JSON Feed for the News Feed on the client's Status Page CustomLinks []CustomLink // Custom external links for client's User menu, as passed in via CLI/ENV Logger chronograf.Logger }
AllRoutes is a handler that returns all links to resources in Chronograf server, as well as external links for the client to know about, such as for JSON feeds or custom side nav buttons. Optionally, routes for authentication can be returned.
type AssetsOpts ¶
type AssetsOpts struct { // Develop when true serves assets from ui/build directory directly; false will use embedded files. Develop bool // Logger will log the asset served Logger chronograf.Logger }
AssetsOpts configures the asset middleware
type AuthRoute ¶
type AuthRoute struct { Name string `json:"name"` // Name uniquely identifies the provider Label string `json:"label"` // Label is a user-facing string to present in the UI Login string `json:"login"` // Login is the route to the login redirect path Logout string `json:"logout"` // Logout is the route to the logout redirect path Callback string `json:"callback"` // Callback is the route the provider calls to exchange the code/state RedirectLogin bool `json:"redirectLogin"` // RedirectLogin tells the ui to redirect to this auth's login. }
AuthRoute are the routes for each type of OAuth2 provider
type AuthRoutes ¶
type AuthRoutes []AuthRoute
AuthRoutes contains all OAuth2 provider routes.
func AuthAPI ¶
func AuthAPI(opts MuxOpts, router chronograf.Router) (http.Handler, AuthRoutes)
AuthAPI adds the OAuth routes if auth is enabled.
type CustomLink ¶
CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
func NewCustomLinks ¶
func NewCustomLinks(links map[string]string) ([]CustomLink, error)
NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV var data into a data structure that the Chronograf client will expect
type DashboardBuilder ¶
type DashboardBuilder interface {
Build(chronograf.DashboardsStore) (*multistore.DashboardsStore, error)
}
DashboardBuilder is responsible for building dashboards
type DataStore ¶
type DataStore interface { Sources(ctx context.Context) chronograf.SourcesStore Servers(ctx context.Context) chronograf.ServersStore Layouts(ctx context.Context) chronograf.LayoutsStore Protoboards(ctx context.Context) chronograf.ProtoboardsStore Users(ctx context.Context) chronograf.UsersStore Organizations(ctx context.Context) chronograf.OrganizationsStore Mappings(ctx context.Context) chronograf.MappingsStore Dashboards(ctx context.Context) chronograf.DashboardsStore Config(ctx context.Context) chronograf.ConfigStore OrganizationConfig(ctx context.Context) chronograf.OrganizationConfigStore }
DataStore is collection of resources that are used by the Service Abstracting this into an interface was useful for isolated testing
type ErrorMessage ¶
ErrorMessage is the error response format for all service errors
type InfluxClient ¶
type InfluxClient struct{}
InfluxClient returns a new client to connect to OSS or Enterprise
func (*InfluxClient) New ¶
func (c *InfluxClient) New(src chronograf.Source, logger chronograf.Logger) (chronograf.TimeSeries, error)
New creates a client to connect to OSS or enterprise
type KapacitorBuilder ¶
type KapacitorBuilder interface {
Build(chronograf.ServersStore) (*multistore.KapacitorStore, error)
}
KapacitorBuilder builds a KapacitorStore
type KapacitorStatus ¶
type KapacitorStatus struct {
Status string `json:"status"`
}
KapacitorStatus is the current state of a running task
func (*KapacitorStatus) Valid ¶
func (k *KapacitorStatus) Valid() error
Valid check if the kapacitor status is enabled or disabled
type LayoutBuilder ¶
type LayoutBuilder interface {
Build() (*multistore.Layouts, error)
}
LayoutBuilder is responsible for building Layouts
type MountableRouter ¶
type MountableRouter struct { Prefix string Delegate chronograf.Router }
MountableRouter is an implementation of a chronograf.Router which supports prefixing each route of a Delegated chronograf.Router with a prefix.
func (*MountableRouter) DELETE ¶
func (mr *MountableRouter) DELETE(path string, handler http.HandlerFunc)
DELETE defines a route responding to a DELETE request that will be prefixed with the configured route prefix
func (*MountableRouter) GET ¶
func (mr *MountableRouter) GET(path string, handler http.HandlerFunc)
GET defines a route responding to a GET request that will be prefixed with the configured route prefix
func (*MountableRouter) Handler ¶
func (mr *MountableRouter) Handler(method string, path string, handler http.Handler)
Handler defines a prefixed route responding to a request type specified in the method parameter
func (*MountableRouter) PATCH ¶
func (mr *MountableRouter) PATCH(path string, handler http.HandlerFunc)
PATCH defines a route responding to a PATCH request that will be prefixed with the configured route prefix
func (*MountableRouter) POST ¶
func (mr *MountableRouter) POST(path string, handler http.HandlerFunc)
POST defines a route responding to a POST request that will be prefixed with the configured route prefix
func (*MountableRouter) PUT ¶
func (mr *MountableRouter) PUT(path string, handler http.HandlerFunc)
PUT defines a route responding to a PUT request that will be prefixed with the configured route prefix
func (*MountableRouter) ServeHTTP ¶
func (mr *MountableRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServeHTTP is an implementation of http.Handler which delegates to the configured Delegate's implementation of http.Handler
type MultiDashboardBuilder ¶
type MultiDashboardBuilder struct { Logger chronograf.Logger ID chronograf.ID Path string }
MultiDashboardBuilder builds a DashboardsStore backed by bolt and the filesystem
func (*MultiDashboardBuilder) Build ¶
func (builder *MultiDashboardBuilder) Build(db chronograf.DashboardsStore) (*multistore.DashboardsStore, error)
Build will construct a Dashboard store of filesystem and db-backed dashboards
type MultiKapacitorBuilder ¶
type MultiKapacitorBuilder struct { KapacitorURL string KapacitorUsername string KapacitorPassword string Logger chronograf.Logger ID chronograf.ID Path string }
MultiKapacitorBuilder implements KapacitorBuilder
func (*MultiKapacitorBuilder) Build ¶
func (builder *MultiKapacitorBuilder) Build(db chronograf.ServersStore) (*multistore.KapacitorStore, error)
Build will return a multistore facade KapacitorStore over memdb and bolt
type MultiLayoutBuilder ¶
type MultiLayoutBuilder struct { Logger chronograf.Logger UUID chronograf.ID CannedPath string }
MultiLayoutBuilder implements LayoutBuilder and will return a Layouts
func (*MultiLayoutBuilder) Build ¶
func (builder *MultiLayoutBuilder) Build() (*multistore.Layouts, error)
Build will construct a Layouts of canned personalized layouts.
type MultiOrganizationBuilder ¶
type MultiOrganizationBuilder struct { Logger chronograf.Logger Path string }
MultiOrganizationBuilder builds a OrganizationsStore backed by bolt and the filesystem
func (*MultiOrganizationBuilder) Build ¶
func (builder *MultiOrganizationBuilder) Build(db chronograf.OrganizationsStore) (*multistore.OrganizationsStore, error)
Build will construct a Organization store of filesystem and db-backed dashboards
type MultiProtoboardsBuilder ¶
type MultiProtoboardsBuilder struct { Logger chronograf.Logger UUID chronograf.ID ProtoboardsPath string }
MultiProtoboardsBuilder implements LayoutBuilder and will return a Layouts
func (*MultiProtoboardsBuilder) Build ¶
func (builder *MultiProtoboardsBuilder) Build() (*multistore.Protoboards, error)
Build will construct a Layouts of canned and db-backed personalized layouts
type MultiSourceBuilder ¶
type MultiSourceBuilder struct { InfluxDBURL string InfluxDBUsername string InfluxDBPassword string InfluxDBOrg string InfluxDBToken string Logger chronograf.Logger ID chronograf.ID Path string }
MultiSourceBuilder implements SourcesBuilder
func (*MultiSourceBuilder) Build ¶
func (fs *MultiSourceBuilder) Build(db chronograf.SourcesStore) (*multistore.SourcesStore, error)
Build will return a MultiSourceStore
type MuxOpts ¶
type MuxOpts struct { Logger chronograf.Logger Develop bool // Develop loads assets from filesystem instead of embedded files Basepath string // URL path prefix under which all chronograf routes will be mounted UseAuth bool // UseAuth turns on Github OAuth and JWT RedirAuth string // RedirAuth specifies which auth to redirect login. Auth oauth2.Authenticator // Auth is used to authenticate and authorize ProviderFuncs []func(func(oauth2.Provider, oauth2.Mux)) StatusFeedURL string // JSON Feed URL for the client Status page News Feed CustomLinks []CustomLink // Any custom external links for client's User menu PprofEnabled bool // Mount pprof routes for profiling DisableGZip bool // Optionally disable gzip. BasicAuth *basicAuth.BasicAuth // HTTP basic authentication provider // contains filtered or unexported fields }
MuxOpts are the options for the router. Mostly related to auth.
type OrganizationBuilder ¶
type OrganizationBuilder interface {
Build(chronograf.OrganizationsStore) (*multistore.OrganizationsStore, error)
}
OrganizationBuilder is responsible for building dashboards
type ProtoboardsBuilder ¶
type ProtoboardsBuilder interface {
Build() (*multistore.Protoboards, error)
}
ProtoboardsBuilder is responsible for building Protoboards
type QueriesRequest ¶
type QueriesRequest struct { Queries []QueryRequest `json:"queries"` TemplateVars []chronograf.TemplateVar `json:"tempVars,omitempty"` }
QueriesRequest converts all queries to queryConfigs with the help of the template variables
type QueriesResponse ¶
type QueriesResponse struct {
Queries []QueryResponse `json:"queries"`
}
QueriesResponse is the response for a QueriesRequest
type QueryRequest ¶
QueryRequest is query that will be converted to a queryConfig
type QueryResponse ¶
type QueryResponse struct { Duration int64 `json:"durationMs"` ID string `json:"id"` Query string `json:"query"` QueryConfig chronograf.QueryConfig `json:"queryConfig"` QueryAST *queries.SelectStatement `json:"queryAST,omitempty"` QueryTemplated *string `json:"queryTemplated,omitempty"` }
QueryResponse is the return result of a QueryRequest including the raw query, the templated query, the queryConfig and the queryAST
type Server ¶
type Server struct { Host string `long:"host" description:"The IP to listen on" default:"0.0.0.0" env:"HOST"` Port int `` /* 126-byte string literal not displayed */ DisableGZip bool `` /* 145-byte string literal not displayed */ PprofEnabled bool `long:"pprof-enabled" description:"Enable the /debug/pprof/* HTTP routes" env:"PPROF_ENABLED"` Cert flags.Filename `long:"cert" description:"Path to PEM encoded public key certificate. " env:"TLS_CERTIFICATE"` Key flags.Filename `long:"key" description:"Path to private key associated with given certificate. " env:"TLS_PRIVATE_KEY"` InfluxDBURL string `long:"influxdb-url" description:"Location of your InfluxDB instance" env:"INFLUXDB_URL"` InfluxDBUsername string `long:"influxdb-username" description:"Username for your InfluxDB instance" env:"INFLUXDB_USERNAME"` InfluxDBPassword string `long:"influxdb-password" description:"Password for your InfluxDB instance" env:"INFLUXDB_PASSWORD"` InfluxDBOrg string `long:"influxdb-org" description:"Organization for your InfluxDB v2 instance" env:"INFLUXDB_ORG"` InfluxDBToken string `long:"influxdb-token" description:"Token for your InfluxDB v2 instance" env:"INFLUXDB_TOKEN"` KapacitorURL string `long:"kapacitor-url" description:"Location of your Kapacitor instance" env:"KAPACITOR_URL"` KapacitorUsername string `long:"kapacitor-username" description:"Username of your Kapacitor instance" env:"KAPACITOR_USERNAME"` KapacitorPassword string `long:"kapacitor-password" description:"Password of your Kapacitor instance" env:"KAPACITOR_PASSWORD"` Develop bool `short:"d" long:"develop" description:"Run server in develop mode."` BoltPath string `` /* 136-byte string literal not displayed */ CannedPath string `` /* 160-byte string literal not displayed */ ProtoboardsPath string `` /* 151-byte string literal not displayed */ ResourcesPath string `` /* 190-byte string literal not displayed */ TokenSecret string `short:"t" long:"token-secret" description:"Secret to sign tokens" env:"TOKEN_SECRET"` JwksURL string `long:"jwks-url" description:"URL that returns OpenID Key Discovery JWKS document." env:"JWKS_URL"` UseIDToken bool `long:"use-id-token" description:"Enable id_token processing." env:"USE_ID_TOKEN"` LoginHint string `` /* 131-byte string literal not displayed */ AuthDuration time.Duration `` /* 179-byte string literal not displayed */ InactivityDuration time.Duration `` /* 141-byte string literal not displayed */ GithubClientID string `short:"i" long:"github-client-id" description:"Github Client ID for OAuth 2 support" env:"GH_CLIENT_ID"` GithubClientSecret string `short:"s" long:"github-client-secret" description:"Github Client Secret for OAuth 2 support" env:"GH_CLIENT_SECRET"` GithubOrgs []string `` /* 141-byte string literal not displayed */ GithubURL string `` /* 130-byte string literal not displayed */ EtcdEndpoints []string `short:"e" long:"etcd-endpoints" description:"List of etcd endpoints" env:"ETCD_ENDPOINTS" env-delim:","` EtcdUsername string `long:"etcd-username" description:"Username to log into etcd." env:"ETCD_USERNAME"` EtcdPassword string `long:"etcd-password" description:"Password to log into etcd." env:"ETCD_PASSWORD"` EtcdDialTimeout time.Duration `` /* 170-byte string literal not displayed */ EtcdRequestTimeout time.Duration `` /* 164-byte string literal not displayed */ EtcdCert flags.Filename `long:"etcd-cert" description:"Path to PEM encoded TLS public key certificate. " env:"ETCD_CERTIFICATE"` EtcdKey flags.Filename `long:"etcd-key" description:"Path to private key associated with given certificate. " env:"ETCD_PRIVATE_KEY"` EtcdRootCA flags.Filename `long:"etcd-root-ca" description:"File location of root CA cert for TLS verification." env:"ETCD_ROOT_CA"` GoogleClientID string `long:"google-client-id" description:"Google Client ID for OAuth 2 support" env:"GOOGLE_CLIENT_ID"` GoogleClientSecret string `long:"google-client-secret" description:"Google Client Secret for OAuth 2 support" env:"GOOGLE_CLIENT_SECRET"` GoogleDomains []string `` /* 133-byte string literal not displayed */ PublicURL string `` /* 166-byte string literal not displayed */ HerokuClientID string `long:"heroku-client-id" description:"Heroku Client ID for OAuth 2 support" env:"HEROKU_CLIENT_ID"` HerokuSecret string `long:"heroku-secret" description:"Heroku Secret for OAuth 2 support" env:"HEROKU_SECRET"` HerokuOrganizations []string `` /* 174-byte string literal not displayed */ GenericName string `long:"generic-name" description:"Generic OAuth2 name presented on the login page" env:"GENERIC_NAME"` GenericClientID string `long:"generic-client-id" description:"Generic OAuth2 Client ID. Can be used own OAuth2 service." env:"GENERIC_CLIENT_ID"` GenericClientSecret string `long:"generic-client-secret" description:"Generic OAuth2 Client Secret" env:"GENERIC_CLIENT_SECRET"` GenericScopes []string `` /* 135-byte string literal not displayed */ GenericDomains []string `` /* 128-byte string literal not displayed */ GenericAuthURL string `long:"generic-auth-url" description:"OAuth 2.0 provider's authorization endpoint URL" env:"GENERIC_AUTH_URL"` GenericTokenURL string `long:"generic-token-url" description:"OAuth 2.0 provider's token endpoint URL" env:"GENERIC_TOKEN_URL"` GenericAPIURL string `long:"generic-api-url" description:"URL that returns OpenID UserInfo compatible information." env:"GENERIC_API_URL"` GenericAPIKey string `` /* 148-byte string literal not displayed */ GenericInsecure bool `long:"generic-insecure" description:"Whether or not to verify auth-url's tls certificates." env:"GENERIC_INSECURE"` GenericRootCA flags.Filename `long:"generic-root-ca" description:"File location of root ca cert for generic oauth tls verification." env:"GENERIC_ROOT_CA"` OAuthNoPKCE bool `long:"oauth-no-pkce" description:"Disables OAuth PKCE." env:"OAUTH_NO_PKCE"` Auth0Domain string `long:"auth0-domain" description:"Subdomain of auth0.com used for Auth0 OAuth2 authentication" env:"AUTH0_DOMAIN"` Auth0ClientID string `long:"auth0-client-id" description:"Auth0 Client ID for OAuth2 support" env:"AUTH0_CLIENT_ID"` Auth0ClientSecret string `long:"auth0-client-secret" description:"Auth0 Client Secret for OAuth2 support" env:"AUTH0_CLIENT_SECRET"` Auth0Organizations []string `` /* 140-byte string literal not displayed */ Auth0SuperAdminOrg string `` /* 148-byte string literal not displayed */ RedirAuth string `long:"redir-auth-login" description:"Automatically redirect login to specified OAuth provider." env:"REDIR_AUTH_LOGIN"` PubKey string `long:"pub-key" description:"Public key or superadmin token authentication" env:"PUB_KEY"` PubKeyFile flags.Filename `long:"pub-key-file" description:"File location of public key for superadmin token authentication." env:"PUB_KEY_FILE"` NonceExpiration time.Duration `` /* 159-byte string literal not displayed */ StatusFeedURL string `` /* 173-byte string literal not displayed */ CustomLinks map[string]string `` /* 561-byte string literal not displayed */ TelegrafSystemInterval time.Duration `` /* 152-byte string literal not displayed */ HostPageDisabled bool `short:"H" long:"host-page-disabled" description:"Disable the host list page" env:"HOST_PAGE_DISABLED"` ReportingDisabled bool `` /* 159-byte string literal not displayed */ CustomAutoRefresh string `` /* 158-byte string literal not displayed */ LogLevel string `` /* 157-byte string literal not displayed */ Basepath string `` /* 229-byte string literal not displayed */ ShowVersion bool `short:"v" long:"version" description:"Show Chronograf version info"` BuildInfo chronograf.BuildInfo BasicAuthRealm string `long:"basic-auth-realm" default:"Chronograf" description:"User visible basic authentication realm" env:"BASICAUTH_REALM"` BasicAuthHtpasswd flags.Filename `` /* 128-byte string literal not displayed */ TLSCiphers string `` /* 142-byte string literal not displayed */ TLSMinVersion string `` /* 133-byte string literal not displayed */ TLSMaxVersion string `long:"tls-max-version" description:"Maximum version of the TLS protocol that will be negotiated." env:"TLS_MAX_VERSION"` // contains filtered or unexported fields }
Server for the chronograf API
func (*Server) NewListener ¶
NewListener will return an http or https listener depending useTLS().
func (*Server) UseGenericOAuth2 ¶
UseGenericOAuth2 validates the CLI parameters to enable generic oauth support
type Service ¶
type Service struct { Store DataStore TimeSeriesClient TimeSeriesClient Logger chronograf.Logger UseAuth bool SuperAdminProviderGroups superAdminProviderGroups Env chronograf.Environment Databases chronograf.Databases }
Service handles REST calls to the persistence
func (*Service) Annotation ¶
func (s *Service) Annotation(w http.ResponseWriter, r *http.Request)
Annotation returns a specified annotation id within the annotations store
func (*Service) Annotations ¶
func (s *Service) Annotations(w http.ResponseWriter, r *http.Request)
Annotations returns all annotations within the annotations store
func (*Service) AuthConfig ¶
func (s *Service) AuthConfig(w http.ResponseWriter, r *http.Request)
AuthConfig retrieves the auth section of the global application configuration
func (*Service) Config ¶
func (s *Service) Config(w http.ResponseWriter, r *http.Request)
Config retrieves the global application configuration
func (*Service) DashboardCellID ¶
func (s *Service) DashboardCellID(w http.ResponseWriter, r *http.Request)
DashboardCellID gets a specific cell from an existing dashboard
func (*Service) DashboardCells ¶
func (s *Service) DashboardCells(w http.ResponseWriter, r *http.Request)
DashboardCells returns all cells from a dashboard within the store
func (*Service) DashboardID ¶
func (s *Service) DashboardID(w http.ResponseWriter, r *http.Request)
DashboardID returns a single specified dashboard
func (*Service) Dashboards ¶
func (s *Service) Dashboards(w http.ResponseWriter, r *http.Request)
Dashboards returns all dashboards within the store
func (*Service) DefaultRP ¶
func (s *Service) DefaultRP(ctx context.Context, qc *chronograf.QueryConfig, src *chronograf.Source) error
DefaultRP will add the default retention policy to the QC if one has not been specified
func (*Service) DropDatabase ¶
func (h *Service) DropDatabase(w http.ResponseWriter, r *http.Request)
DropDatabase removes a database from a data source
func (*Service) DropRetentionPolicy ¶
func (h *Service) DropRetentionPolicy(w http.ResponseWriter, r *http.Request)
DropRetentionPolicy removes a retention policy from a database
func (*Service) Environment ¶
func (s *Service) Environment(w http.ResponseWriter, r *http.Request)
Environment retrieves the global application configuration
func (*Service) Flux ¶
func (s *Service) Flux(w http.ResponseWriter, r *http.Request)
Flux returns a list of links for the Flux API
func (*Service) FluxSuggestion ¶
func (s *Service) FluxSuggestion(w http.ResponseWriter, r *http.Request)
FluxSuggestion returns the function parameters for the requested function
func (*Service) FluxSuggestions ¶
func (s *Service) FluxSuggestions(w http.ResponseWriter, r *http.Request)
FluxSuggestions returns a list of available Flux functions for the Flux Builder
func (*Service) GetDatabases ¶
func (h *Service) GetDatabases(w http.ResponseWriter, r *http.Request)
GetDatabases queries the list of all databases for a source
func (*Service) Influx ¶
func (s *Service) Influx(w http.ResponseWriter, r *http.Request)
Influx proxies requests to influxdb.
func (*Service) KapacitorRulesDelete ¶
func (s *Service) KapacitorRulesDelete(w http.ResponseWriter, r *http.Request)
KapacitorRulesDelete proxies DELETE to kapacitor
func (*Service) KapacitorRulesGet ¶
func (s *Service) KapacitorRulesGet(w http.ResponseWriter, r *http.Request)
KapacitorRulesGet retrieves all rules
func (*Service) KapacitorRulesID ¶
func (s *Service) KapacitorRulesID(w http.ResponseWriter, r *http.Request)
KapacitorRulesID retrieves specific task
func (*Service) KapacitorRulesPost ¶
func (s *Service) KapacitorRulesPost(w http.ResponseWriter, r *http.Request)
KapacitorRulesPost proxies POST to kapacitor
func (*Service) KapacitorRulesPut ¶
func (s *Service) KapacitorRulesPut(w http.ResponseWriter, r *http.Request)
KapacitorRulesPut proxies PATCH to kapacitor
func (*Service) KapacitorRulesStatus ¶
func (s *Service) KapacitorRulesStatus(w http.ResponseWriter, r *http.Request)
KapacitorRulesStatus proxies PATCH to kapacitor to enable/disable tasks
func (*Service) Kapacitors ¶
func (s *Service) Kapacitors(w http.ResponseWriter, r *http.Request)
Kapacitors retrieves all kapacitors from store.
func (*Service) KapacitorsID ¶
func (s *Service) KapacitorsID(w http.ResponseWriter, r *http.Request)
KapacitorsID retrieves a kapacitor with ID from store.
func (*Service) Layouts ¶
func (s *Service) Layouts(w http.ResponseWriter, r *http.Request)
Layouts retrieves all layouts from store
func (*Service) LayoutsID ¶
func (s *Service) LayoutsID(w http.ResponseWriter, r *http.Request)
LayoutsID retrieves layout with ID from store
func (*Service) Mappings ¶
func (s *Service) Mappings(w http.ResponseWriter, r *http.Request)
Mappings retrives all mappings
func (*Service) Me ¶
func (s *Service) Me(w http.ResponseWriter, r *http.Request)
Me does a findOrCreate based on the username in the context
func (*Service) Measurements ¶
func (h *Service) Measurements(w http.ResponseWriter, r *http.Request)
Measurements lists measurements within a database
func (*Service) NewAnnotation ¶
func (s *Service) NewAnnotation(w http.ResponseWriter, r *http.Request)
NewAnnotation adds the annotation from a POST body to the annotations store
func (*Service) NewDashboard ¶
func (s *Service) NewDashboard(w http.ResponseWriter, r *http.Request)
NewDashboard creates and returns a new dashboard object
func (*Service) NewDashboardCell ¶
func (s *Service) NewDashboardCell(w http.ResponseWriter, r *http.Request)
NewDashboardCell adds a cell to an existing dashboard
func (*Service) NewDatabase ¶
func (h *Service) NewDatabase(w http.ResponseWriter, r *http.Request)
NewDatabase creates a new database within the datastore
func (*Service) NewKapacitor ¶
func (s *Service) NewKapacitor(w http.ResponseWriter, r *http.Request)
NewKapacitor adds valid kapacitor store store.
func (*Service) NewMapping ¶
func (s *Service) NewMapping(w http.ResponseWriter, r *http.Request)
NewMapping adds a new mapping
func (*Service) NewOrganization ¶
func (s *Service) NewOrganization(w http.ResponseWriter, r *http.Request)
NewOrganization adds a new organization to store
func (*Service) NewRetentionPolicy ¶
func (h *Service) NewRetentionPolicy(w http.ResponseWriter, r *http.Request)
NewRetentionPolicy creates a new retention policy for a database
func (*Service) NewService ¶
func (s *Service) NewService(w http.ResponseWriter, r *http.Request)
NewService adds valid service store store.
func (*Service) NewSource ¶
func (s *Service) NewSource(w http.ResponseWriter, r *http.Request)
NewSource adds a new valid source to the store
func (*Service) NewSourceRole ¶
func (s *Service) NewSourceRole(w http.ResponseWriter, r *http.Request)
NewSourceRole adds role to source
func (*Service) NewSourceUser ¶
func (s *Service) NewSourceUser(w http.ResponseWriter, r *http.Request)
NewSourceUser adds user to source
func (*Service) NewTemplate ¶
func (s *Service) NewTemplate(w http.ResponseWriter, r *http.Request)
NewTemplate adds a template to an existing dashboard
func (*Service) NewUser ¶
func (s *Service) NewUser(w http.ResponseWriter, r *http.Request)
NewUser adds a new Chronograf user to store
func (*Service) OrganizationConfig ¶
func (s *Service) OrganizationConfig(w http.ResponseWriter, r *http.Request)
OrganizationConfig retrieves the organization-wide config settings
func (*Service) OrganizationID ¶
func (s *Service) OrganizationID(w http.ResponseWriter, r *http.Request)
OrganizationID retrieves a organization with ID from store
func (*Service) OrganizationLogViewerConfig ¶
func (s *Service) OrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request)
OrganizationLogViewerConfig retrieves the log viewer UI section of the organization config This uses a FindOrCreate function to ensure that any new organizations have default organization config values, without having to associate organization creation with organization config creation.
func (*Service) Organizations ¶
func (s *Service) Organizations(w http.ResponseWriter, r *http.Request)
Organizations retrieves all organizations from store
func (*Service) Permissions ¶
func (s *Service) Permissions(w http.ResponseWriter, r *http.Request)
Permissions returns all possible permissions for this source.
func (*Service) Protoboards ¶
func (s *Service) Protoboards(w http.ResponseWriter, r *http.Request)
Protoboards retrieves all protoboards from store
func (*Service) ProtoboardsID ¶
func (s *Service) ProtoboardsID(w http.ResponseWriter, r *http.Request)
ProtoboardsID retrieves protoboard with ID from store
func (*Service) Proxy ¶
func (s *Service) Proxy(w http.ResponseWriter, r *http.Request)
Proxy proxies requests to services using the path query parameter.
func (*Service) ProxyDelete ¶
func (s *Service) ProxyDelete(w http.ResponseWriter, r *http.Request)
ProxyDelete proxies DELETE to service
func (*Service) ProxyFlux ¶
func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request)
ProxyFlux proxies requests to influxdb using the path query parameter.
func (*Service) ProxyGet ¶
func (s *Service) ProxyGet(w http.ResponseWriter, r *http.Request)
ProxyGet proxies GET to service
func (*Service) ProxyPatch ¶
func (s *Service) ProxyPatch(w http.ResponseWriter, r *http.Request)
ProxyPatch proxies PATCH to Service
func (*Service) ProxyPost ¶
func (s *Service) ProxyPost(w http.ResponseWriter, r *http.Request)
ProxyPost proxies POST to service
func (*Service) Queries ¶
func (s *Service) Queries(w http.ResponseWriter, r *http.Request)
Queries analyzes InfluxQL to produce front-end friendly QueryConfig
func (*Service) RemoveAnnotation ¶
func (s *Service) RemoveAnnotation(w http.ResponseWriter, r *http.Request)
RemoveAnnotation removes the annotation from the time series source
func (*Service) RemoveDashboard ¶
func (s *Service) RemoveDashboard(w http.ResponseWriter, r *http.Request)
RemoveDashboard deletes a dashboard
func (*Service) RemoveDashboardCell ¶
func (s *Service) RemoveDashboardCell(w http.ResponseWriter, r *http.Request)
RemoveDashboardCell removes a specific cell from an existing dashboard
func (*Service) RemoveKapacitor ¶
func (s *Service) RemoveKapacitor(w http.ResponseWriter, r *http.Request)
RemoveKapacitor deletes kapacitor from store.
func (*Service) RemoveMapping ¶
func (s *Service) RemoveMapping(w http.ResponseWriter, r *http.Request)
RemoveMapping removes a mapping
func (*Service) RemoveOrganization ¶
func (s *Service) RemoveOrganization(w http.ResponseWriter, r *http.Request)
RemoveOrganization removes an organization in the organizations store
func (*Service) RemoveService ¶
func (s *Service) RemoveService(w http.ResponseWriter, r *http.Request)
RemoveService deletes service from store.
func (*Service) RemoveSource ¶
func (s *Service) RemoveSource(w http.ResponseWriter, r *http.Request)
RemoveSource deletes the source from the store
func (*Service) RemoveSourceRole ¶
func (s *Service) RemoveSourceRole(w http.ResponseWriter, r *http.Request)
RemoveSourceRole removes role from data source.
func (*Service) RemoveSourceUser ¶
func (s *Service) RemoveSourceUser(w http.ResponseWriter, r *http.Request)
RemoveSourceUser removes the user from the InfluxDB source
func (*Service) RemoveTemplate ¶
func (s *Service) RemoveTemplate(w http.ResponseWriter, r *http.Request)
RemoveTemplate removes a specific template from an existing dashboard
func (*Service) RemoveUser ¶
func (s *Service) RemoveUser(w http.ResponseWriter, r *http.Request)
RemoveUser deletes a Chronograf user from store
func (*Service) ReplaceAuthConfig ¶
func (s *Service) ReplaceAuthConfig(w http.ResponseWriter, r *http.Request)
ReplaceAuthConfig replaces the auth section of the global application configuration
func (*Service) ReplaceDashboard ¶
func (s *Service) ReplaceDashboard(w http.ResponseWriter, r *http.Request)
ReplaceDashboard completely replaces a dashboard
func (*Service) ReplaceDashboardCell ¶
func (s *Service) ReplaceDashboardCell(w http.ResponseWriter, r *http.Request)
ReplaceDashboardCell replaces a cell entirely within an existing dashboard
func (*Service) ReplaceOrganizationLogViewerConfig ¶
func (s *Service) ReplaceOrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request)
ReplaceOrganizationLogViewerConfig replaces the log viewer UI section of the organization config
func (*Service) ReplaceTemplate ¶
func (s *Service) ReplaceTemplate(w http.ResponseWriter, r *http.Request)
ReplaceTemplate replaces a template entirely within an existing dashboard
func (*Service) RetentionPolicies ¶
func (h *Service) RetentionPolicies(w http.ResponseWriter, r *http.Request)
RetentionPolicies lists retention policies within a database
func (*Service) ServiceID ¶
func (s *Service) ServiceID(w http.ResponseWriter, r *http.Request)
ServiceID retrieves a service with ID from store.
func (*Service) Services ¶
func (s *Service) Services(w http.ResponseWriter, r *http.Request)
Services retrieves all services from store.
func (*Service) SourceHealth ¶
func (s *Service) SourceHealth(w http.ResponseWriter, r *http.Request)
SourceHealth determines if the tsdb is running
func (*Service) SourceRoleID ¶
func (s *Service) SourceRoleID(w http.ResponseWriter, r *http.Request)
SourceRoleID retrieves a role with ID from store.
func (*Service) SourceRoles ¶
func (s *Service) SourceRoles(w http.ResponseWriter, r *http.Request)
SourceRoles retrieves all roles from the store
func (*Service) SourceUserID ¶
func (s *Service) SourceUserID(w http.ResponseWriter, r *http.Request)
SourceUserID retrieves a user with ID from store. In InfluxDB, a User's Name is their UID, hence the semantic below.
func (*Service) SourceUsers ¶
func (s *Service) SourceUsers(w http.ResponseWriter, r *http.Request)
SourceUsers retrieves all users from source.
func (*Service) Sources ¶
func (s *Service) Sources(w http.ResponseWriter, r *http.Request)
Sources returns all sources from the store.
func (*Service) SourcesID ¶
func (s *Service) SourcesID(w http.ResponseWriter, r *http.Request)
SourcesID retrieves a source from the store
func (*Service) TemplateID ¶
func (s *Service) TemplateID(w http.ResponseWriter, r *http.Request)
TemplateID retrieves a specific template from a dashboard
func (*Service) Templates ¶
func (s *Service) Templates(w http.ResponseWriter, r *http.Request)
Templates returns all templates from a dashboard within the store
func (*Service) TimeSeries ¶
func (s *Service) TimeSeries(src chronograf.Source) (chronograf.TimeSeries, error)
TimeSeries returns a new client connected to a time series database
func (*Service) UpdateAnnotation ¶
func (s *Service) UpdateAnnotation(w http.ResponseWriter, r *http.Request)
UpdateAnnotation overwrite an existing annotation
func (*Service) UpdateDashboard ¶
func (s *Service) UpdateDashboard(w http.ResponseWriter, r *http.Request)
UpdateDashboard completely updates either the dashboard name or the cells
func (*Service) UpdateKapacitor ¶
func (s *Service) UpdateKapacitor(w http.ResponseWriter, r *http.Request)
UpdateKapacitor incrementally updates a kapacitor definition in the store
func (*Service) UpdateMapping ¶
func (s *Service) UpdateMapping(w http.ResponseWriter, r *http.Request)
UpdateMapping updates a mapping
func (*Service) UpdateMe ¶
func (s *Service) UpdateMe(auth oauth2.Authenticator) func(http.ResponseWriter, *http.Request)
UpdateMe changes the user's current organization on the JWT and responds with the same semantics as Me
func (*Service) UpdateOrganization ¶
func (s *Service) UpdateOrganization(w http.ResponseWriter, r *http.Request)
UpdateOrganization updates an organization in the organizations store
func (*Service) UpdateRetentionPolicy ¶
func (h *Service) UpdateRetentionPolicy(w http.ResponseWriter, r *http.Request)
UpdateRetentionPolicy modifies an existing retention policy for a database
func (*Service) UpdateService ¶
func (s *Service) UpdateService(w http.ResponseWriter, r *http.Request)
UpdateService incrementally updates a service definition in the store
func (*Service) UpdateSource ¶
func (s *Service) UpdateSource(w http.ResponseWriter, r *http.Request)
UpdateSource handles incremental updates of a data source
func (*Service) UpdateSourceRole ¶
func (s *Service) UpdateSourceRole(w http.ResponseWriter, r *http.Request)
UpdateSourceRole changes the permissions or users of a role
func (*Service) UpdateSourceUser ¶
func (s *Service) UpdateSourceUser(w http.ResponseWriter, r *http.Request)
UpdateSourceUser changes the password or permissions of a source user
func (*Service) UpdateUser ¶
func (s *Service) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser updates a Chronograf user in store
func (*Service) UserID ¶
func (s *Service) UserID(w http.ResponseWriter, r *http.Request)
UserID retrieves a Chronograf user with ID from store
func (*Service) Users ¶
func (s *Service) Users(w http.ResponseWriter, r *http.Request)
Users retrieves all Chronograf users from store
func (*Service) ValidateTextTemplate ¶
func (s *Service) ValidateTextTemplate(w http.ResponseWriter, r *http.Request)
ValidateTextTemplate will validate the template string
type SourcesBuilder ¶
type SourcesBuilder interface {
Build(chronograf.SourcesStore) (*multistore.SourcesStore, error)
}
SourcesBuilder builds a MultiSourceStore
type Store ¶
type Store struct { SourcesStore chronograf.SourcesStore ServersStore chronograf.ServersStore LayoutsStore chronograf.LayoutsStore ProtoboardsStore chronograf.ProtoboardsStore UsersStore chronograf.UsersStore DashboardsStore chronograf.DashboardsStore MappingsStore chronograf.MappingsStore OrganizationsStore chronograf.OrganizationsStore ConfigStore chronograf.ConfigStore OrganizationConfigStore chronograf.OrganizationConfigStore }
Store implements the DataStore interface
func (*Store) Config ¶
func (s *Store) Config(ctx context.Context) chronograf.ConfigStore
Config returns the underlying ConfigStore.
func (*Store) Dashboards ¶
func (s *Store) Dashboards(ctx context.Context) chronograf.DashboardsStore
Dashboards returns a noop.DashboardsStore if the context has no organization specified and an organization.DashboardsStore otherwise.
func (*Store) Layouts ¶
func (s *Store) Layouts(ctx context.Context) chronograf.LayoutsStore
Layouts returns all layouts in the underlying layouts store.
func (*Store) Mappings ¶
func (s *Store) Mappings(ctx context.Context) chronograf.MappingsStore
Mappings returns the underlying MappingsStore.
func (*Store) OrganizationConfig ¶
func (s *Store) OrganizationConfig(ctx context.Context) chronograf.OrganizationConfigStore
OrganizationConfig returns a noop.OrganizationConfigStore if the context has no organization specified and an organization.OrganizationConfigStore otherwise.
func (*Store) Organizations ¶
func (s *Store) Organizations(ctx context.Context) chronograf.OrganizationsStore
Organizations returns the underlying OrganizationsStore.
func (*Store) Protoboards ¶
func (s *Store) Protoboards(ctx context.Context) chronograf.ProtoboardsStore
Protoboards returns all protoboards in the underlying protoboards store.
func (*Store) Servers ¶
func (s *Store) Servers(ctx context.Context) chronograf.ServersStore
Servers returns a noop.ServersStore if the context has no organization specified and an organization.ServersStore otherwise.
func (*Store) Sources ¶
func (s *Store) Sources(ctx context.Context) chronograf.SourcesStore
Sources returns a noop.SourcesStore if the context has no organization specified and an organization.SourcesStore otherwise.
func (*Store) Users ¶
func (s *Store) Users(ctx context.Context) chronograf.UsersStore
Users returns a chronograf.UsersStore. If the context is a server context, then the underlying chronograf.UsersStore is returned. If there is an organization specified on context, then an organizations.UsersStore is returned. If niether are specified, a noop.UsersStore is returned.
type SuggestionResponse ¶
SuggestionResponse provides the parameters available for a given Flux function
type SuggestionsResponse ¶
type SuggestionsResponse struct {
Functions []SuggestionResponse `json:"funcs"`
}
SuggestionsResponse provides a list of available Flux functions
type TimeSeriesClient ¶
type TimeSeriesClient interface {
New(chronograf.Source, chronograf.Logger) (chronograf.TimeSeries, error)
}
TimeSeriesClient returns the correct client for a time series database. todo(glinton): should this be always reconnecting?
type URLPrefixer ¶
type URLPrefixer struct { Prefix string // the prefix to be appended after any detected Attrs Next http.Handler // the http.Handler which will generate the content to be modified by this handler Attrs [][]byte // a list of attrs that should have their URLs prefixed. For example `src="` or `href="` would be valid Logger chronograf.Logger // The logger where prefixing errors will be dispatched to }
URLPrefixer is a wrapper for an http.Handler that will prefix all occurrences of a relative URL with the configured Prefix
func NewDefaultURLPrefixer ¶
func NewDefaultURLPrefixer(prefix string, next http.Handler, lg chronograf.Logger) *URLPrefixer
NewDefaultURLPrefixer returns a URLPrefixer that will prefix any src and href attributes found in HTML as well as any url() directives found in CSS with the provided prefix. Additionally, it will prefix any `data-basepath` attributes as well for informing front end logic about any prefixes. `next` is the next http.Handler that will have its output prefixed
func (*URLPrefixer) ServeHTTP ¶
func (up *URLPrefixer) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServeHTTP implements an http.Handler that prefixes relative URLs from the Next handler with the configured prefix. It does this by examining the stream through the ResponseWriter, and appending the Prefix after any of the Attrs detected in the stream.
type ValidTextTemplateRequest ¶
type ValidTextTemplateRequest struct {
Template string `json:"template"`
}
ValidTextTemplateRequest is the request json for validation
Source Files ¶
- annotations.go
- assets.go
- auth.go
- builders.go
- cells.go
- config.go
- context.go
- dashboards.go
- databases.go
- env.go
- flux.go
- helpers.go
- influx.go
- kapacitors.go
- layout.go
- links.go
- logger.go
- mapping.go
- me.go
- middle.go
- mountable_router.go
- mux.go
- org_config.go
- organizations.go
- permissions.go
- prefixing_redirector.go
- protoboards.go
- proxy.go
- queries.go
- queryconfig.go
- redoc.go
- routes.go
- server.go
- service.go
- services.go
- sources.go
- stores.go
- swagger.go
- templates.go
- test_helpers.go
- url_prefixer.go
- users.go
- valid_text_templates.go