Versions in this module Expand all Collapse all v0 v0.179.0 Sep 14, 2023 Changes in this version + const CookiesHeaderName + const OAuthIdentityIDTokenHeaderName + const OAuthIdentityTokenHeaderName + var Logger = log.DefaultLogger + var NewLoggerWith = func(args ...interface{}) log.Logger + var PluginProfilerEnvDeprecated = "GF_PLUGINS_PROFILER" + var PluginProfilerPortEnvDeprecated = "GF_PLUGINS_PROFILER_PORT" + var PluginProfilingEnabledEnv = "GF_PLUGIN_PROFILING_ENABLED" + var PluginProfilingPortEnv = "GF_PLUGIN_PROFILING_PORT" + var PluginTracingOpenTelemetryOTLPAddressEnv = "GF_INSTANCE_OTLP_ADDRESS" + var PluginTracingOpenTelemetryOTLPPropagationEnv = "GF_INSTANCE_OTLP_PROPAGATION" + var PluginVersionEnv = "GF_PLUGIN_VERSION" + func GracefulStandaloneServe(dsopts ServeOpts, info standalone.ServerSettings) error + func JSONDataFromHTTPClientOptions(opts httpclient.Options) (res map[string]interface{}) + func Manage(pluginID string, serveOpts ServeOpts) error + func SecureJSONDataFromHTTPClientOptions(opts httpclient.Options) (res map[string]string) + func Serve(opts ServeOpts) error + func SetupPluginEnvironment(pluginID string) + func SetupTracer(pluginID string, tracingOpts tracing.Opts) error + func TestStandaloneServe(opts ServeOpts, address string) (*grpc.Server, error) + type AppInstanceSettings struct + DecryptedSecureJSONData map[string]string + JSONData json.RawMessage + Updated time.Time + func (s *AppInstanceSettings) HTTPClientOptions() (httpclient.Options, error) + type CallResourceHandler interface + CallResource func(ctx context.Context, req *CallResourceRequest, ...) error + type CallResourceHandlerFunc func(ctx context.Context, req *CallResourceRequest, ...) error + func (fn CallResourceHandlerFunc) CallResource(ctx context.Context, req *CallResourceRequest, ...) error + type CallResourceRequest struct + Body []byte + Headers map[string][]string + Method string + Path string + PluginContext PluginContext + URL string + func (req *CallResourceRequest) DeleteHTTPHeader(key string) + func (req *CallResourceRequest) GetHTTPHeader(key string) string + func (req *CallResourceRequest) GetHTTPHeaders() http.Header + func (req *CallResourceRequest) SetHTTPHeader(key, value string) + type CallResourceResponse struct + Body []byte + Headers map[string][]string + Status int + type CallResourceResponseSender interface + Send func(*CallResourceResponse) error + type CheckHealthHandler interface + CheckHealth func(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error) + type CheckHealthHandlerFunc func(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error) + func (fn CheckHealthHandlerFunc) CheckHealth(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error) + type CheckHealthRequest struct + Headers map[string]string + PluginContext PluginContext + func (req *CheckHealthRequest) DeleteHTTPHeader(key string) + func (req *CheckHealthRequest) GetHTTPHeader(key string) string + func (req *CheckHealthRequest) GetHTTPHeaders() http.Header + func (req *CheckHealthRequest) SetHTTPHeader(key, value string) + type CheckHealthResult struct + JSONDetails []byte + Message string + Status HealthStatus + type CollectMetricsHandler interface + CollectMetrics func(ctx context.Context, req *CollectMetricsRequest) (*CollectMetricsResult, error) + type CollectMetricsHandlerFunc func(ctx context.Context, req *CollectMetricsRequest) (*CollectMetricsResult, error) + func (fn CollectMetricsHandlerFunc) CollectMetrics(ctx context.Context, req *CollectMetricsRequest) (*CollectMetricsResult, error) + type CollectMetricsRequest struct + PluginContext PluginContext + type CollectMetricsResult struct + PrometheusMetrics []byte + type ConvertFromProtobuf struct + func FromProto() ConvertFromProtobuf + func (f ConvertFromProtobuf) AppInstanceSettings(proto *pluginv2.AppInstanceSettings) *AppInstanceSettings + func (f ConvertFromProtobuf) CallResourceRequest(protoReq *pluginv2.CallResourceRequest) *CallResourceRequest + func (f ConvertFromProtobuf) CallResourceResponse(protoResp *pluginv2.CallResourceResponse) *CallResourceResponse + func (f ConvertFromProtobuf) CheckHealthRequest(protoReq *pluginv2.CheckHealthRequest) *CheckHealthRequest + func (f ConvertFromProtobuf) CheckHealthResponse(protoResp *pluginv2.CheckHealthResponse) *CheckHealthResult + func (f ConvertFromProtobuf) CollectMetricsRequest(protoReq *pluginv2.CollectMetricsRequest) *CollectMetricsRequest + func (f ConvertFromProtobuf) CollectMetricsResponse(protoResp *pluginv2.CollectMetricsResponse) *CollectMetricsResult + func (f ConvertFromProtobuf) DataQuery(proto *pluginv2.DataQuery) *DataQuery + func (f ConvertFromProtobuf) DataSourceInstanceSettings(proto *pluginv2.DataSourceInstanceSettings, pluginID string) *DataSourceInstanceSettings + func (f ConvertFromProtobuf) PluginContext(proto *pluginv2.PluginContext) PluginContext + func (f ConvertFromProtobuf) PublishStreamRequest(protoReq *pluginv2.PublishStreamRequest) *PublishStreamRequest + func (f ConvertFromProtobuf) PublishStreamResponse(protoReq *pluginv2.PublishStreamResponse) *PublishStreamResponse + func (f ConvertFromProtobuf) QueryDataRequest(protoReq *pluginv2.QueryDataRequest) *QueryDataRequest + func (f ConvertFromProtobuf) QueryDataResponse(protoRes *pluginv2.QueryDataResponse) (*QueryDataResponse, error) + func (f ConvertFromProtobuf) RunStreamRequest(protoReq *pluginv2.RunStreamRequest) *RunStreamRequest + func (f ConvertFromProtobuf) StreamPacket(protoReq *pluginv2.StreamPacket) *StreamPacket + func (f ConvertFromProtobuf) SubscribeStreamRequest(protoReq *pluginv2.SubscribeStreamRequest) *SubscribeStreamRequest + func (f ConvertFromProtobuf) SubscribeStreamResponse(protoReq *pluginv2.SubscribeStreamResponse) *SubscribeStreamResponse + func (f ConvertFromProtobuf) TimeRange(proto *pluginv2.TimeRange) TimeRange + func (f ConvertFromProtobuf) User(user *pluginv2.User) *User + type ConvertToProtobuf struct + func ToProto() ConvertToProtobuf + func (t ConvertToProtobuf) AppInstanceSettings(s *AppInstanceSettings) *pluginv2.AppInstanceSettings + func (t ConvertToProtobuf) CallResourceRequest(req *CallResourceRequest) *pluginv2.CallResourceRequest + func (t ConvertToProtobuf) CallResourceResponse(resp *CallResourceResponse) *pluginv2.CallResourceResponse + func (t ConvertToProtobuf) CheckHealthResponse(res *CheckHealthResult) *pluginv2.CheckHealthResponse + func (t ConvertToProtobuf) CollectMetricsRequest(req *CollectMetricsRequest) *pluginv2.CollectMetricsRequest + func (t ConvertToProtobuf) CollectMetricsResult(res *CollectMetricsResult) *pluginv2.CollectMetricsResponse + func (t ConvertToProtobuf) DataQuery(q DataQuery) *pluginv2.DataQuery + func (t ConvertToProtobuf) DataSourceInstanceSettings(s *DataSourceInstanceSettings) *pluginv2.DataSourceInstanceSettings + func (t ConvertToProtobuf) HealthStatus(status HealthStatus) pluginv2.CheckHealthResponse_HealthStatus + func (t ConvertToProtobuf) PluginContext(pluginCtx PluginContext) *pluginv2.PluginContext + func (t ConvertToProtobuf) PublishStreamRequest(req *PublishStreamRequest) *pluginv2.PublishStreamRequest + func (t ConvertToProtobuf) PublishStreamResponse(req *PublishStreamResponse) *pluginv2.PublishStreamResponse + func (t ConvertToProtobuf) QueryDataRequest(req *QueryDataRequest) *pluginv2.QueryDataRequest + func (t ConvertToProtobuf) QueryDataResponse(res *QueryDataResponse) (*pluginv2.QueryDataResponse, error) + func (t ConvertToProtobuf) RunStreamRequest(req *RunStreamRequest) *pluginv2.RunStreamRequest + func (t ConvertToProtobuf) StreamPacket(p *StreamPacket) *pluginv2.StreamPacket + func (t ConvertToProtobuf) SubscribeStreamRequest(req *SubscribeStreamRequest) *pluginv2.SubscribeStreamRequest + func (t ConvertToProtobuf) SubscribeStreamResponse(req *SubscribeStreamResponse) *pluginv2.SubscribeStreamResponse + func (t ConvertToProtobuf) TimeRange(tr TimeRange) *pluginv2.TimeRange + func (t ConvertToProtobuf) User(user *User) *pluginv2.User + type DataQuery struct + Interval time.Duration + JSON json.RawMessage + MaxDataPoints int64 + QueryType string + RefID string + TimeRange TimeRange + type DataResponse struct + Error error + Frames data.Frames + Status Status + func ErrDataResponse(status Status, message string) DataResponse + func FrameResponse(f data.Framer) *DataResponse + func FrameResponseWithError(f data.Framer, err error) *DataResponse + func (r DataResponse) MarshalJSON() ([]byte, error) + type DataSourceInstanceSettings struct + BasicAuthEnabled bool + BasicAuthUser string + Database string + DecryptedSecureJSONData map[string]string + ID int64 + JSONData json.RawMessage + Name string + Type string + UID string + URL string + Updated time.Time + User string + func (s *DataSourceInstanceSettings) HTTPClientOptions() (httpclient.Options, error) + func (s *DataSourceInstanceSettings) ProxyOptions() (*proxy.Options, error) + type ForwardHTTPHeaders interface + DeleteHTTPHeader func(key string) + GetHTTPHeader func(key string) string + GetHTTPHeaders func() http.Header + SetHTTPHeader func(key, value string) + type GRPCSettings struct + MaxReceiveMsgSize int + MaxSendMsgSize int + type HTTPSettings struct + Access string + BasicAuthEnabled bool + BasicAuthPassword string + BasicAuthUser string + DialTimeout time.Duration + ExpectContinueTimeout time.Duration + Headers map[string]string + IdleConnTimeout time.Duration + JSONData map[string]interface{} + KeepAlive time.Duration + MaxConnsPerHost int + MaxIdleConns int + MaxIdleConnsPerHost int + SecureJSONData map[string]string + SigV4AccessKey string + SigV4AssumeRoleARN string + SigV4Auth bool + SigV4AuthType string + SigV4ExternalID string + SigV4Profile string + SigV4Region string + SigV4SecretKey string + TLSAuthWithCACert bool + TLSCACert string + TLSClientAuth bool + TLSClientCert string + TLSClientKey string + TLSHandshakeTimeout time.Duration + TLSServerName string + TLSSkipVerify bool + Timeout time.Duration + URL string + func (s *HTTPSettings) HTTPClientOptions() httpclient.Options + type HealthStatus int + const HealthStatusError + const HealthStatusOk + const HealthStatusUnknown + func (hs HealthStatus) String() string + type InitialData struct + func NewInitialData(data json.RawMessage) (*InitialData, error) + func NewInitialFrame(frame *data.Frame, include data.FrameInclude) (*InitialData, error) + func (d *InitialData) Data() []byte + type PluginContext struct + AppInstanceSettings *AppInstanceSettings + DataSourceInstanceSettings *DataSourceInstanceSettings + OrgID int64 + PluginID string + User *User + type PublishStreamRequest struct + Data json.RawMessage + Path string + PluginContext PluginContext + type PublishStreamResponse struct + Data json.RawMessage + Status PublishStreamStatus + type PublishStreamStatus int32 + const PublishStreamStatusNotFound + const PublishStreamStatusOK + const PublishStreamStatusPermissionDenied + type QueryDataHandler interface + QueryData func(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, error) + type QueryDataHandlerFunc func(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, error) + func (fn QueryDataHandlerFunc) QueryData(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, error) + type QueryDataRequest struct + Headers map[string]string + PluginContext PluginContext + Queries []DataQuery + func (req *QueryDataRequest) DeleteHTTPHeader(key string) + func (req *QueryDataRequest) GetHTTPHeader(key string) string + func (req *QueryDataRequest) GetHTTPHeaders() http.Header + func (req *QueryDataRequest) SetHTTPHeader(key, value string) + type QueryDataResponse struct + Responses Responses + func NewQueryDataResponse() *QueryDataResponse + func (r *QueryDataResponse) UnmarshalJSON(b []byte) error + func (r QueryDataResponse) MarshalJSON() ([]byte, error) + type Responses map[string]DataResponse + type RunStreamRequest struct + Data json.RawMessage + Path string + PluginContext PluginContext + type ServeOpts struct + CallResourceHandler CallResourceHandler + CheckHealthHandler CheckHealthHandler + GRPCSettings GRPCSettings + QueryDataHandler QueryDataHandler + StreamHandler StreamHandler + type Status int + const StatusBadGateway + const StatusBadRequest + const StatusForbidden + const StatusInternal + const StatusNotFound + const StatusNotImplemented + const StatusOK + const StatusTimeout + const StatusTooManyRequests + const StatusUnauthorized + const StatusUnknown + const StatusValidationFailed + func (s Status) IsValid() bool + func (s Status) String() string + type StreamHandler interface + PublishStream func(context.Context, *PublishStreamRequest) (*PublishStreamResponse, error) + RunStream func(context.Context, *RunStreamRequest, *StreamSender) error + SubscribeStream func(context.Context, *SubscribeStreamRequest) (*SubscribeStreamResponse, error) + type StreamPacket struct + Data json.RawMessage + type StreamPacketSender interface + Send func(*StreamPacket) error + type StreamSender struct + func NewStreamSender(packetSender StreamPacketSender) *StreamSender + func (s *StreamSender) SendBytes(data []byte) error + func (s *StreamSender) SendFrame(frame *data.Frame, include data.FrameInclude) error + func (s *StreamSender) SendJSON(data []byte) error + type SubscribeStreamRequest struct + Data json.RawMessage + Path string + PluginContext PluginContext + type SubscribeStreamResponse struct + InitialData *InitialData + Status SubscribeStreamStatus + type SubscribeStreamStatus int32 + const SubscribeStreamStatusNotFound + const SubscribeStreamStatusOK + const SubscribeStreamStatusPermissionDenied + type TimeRange struct + From time.Time + To time.Time + func (tr TimeRange) Duration() time.Duration + type User struct + Email string + Login string + Name string + Role string