Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDownstreamStatusSource ¶
WithDownstreamStatusSource mutates the provided context by setting the plugin request status source to StatusSourceDownstream. If the provided context does not have a plugin request status source, the context will not be mutated. This means that WithStatusSource has to be called before this function.
func WithStatusSource ¶
func WithStatusSource(ctx context.Context, s StatusSource) context.Context
WithStatusSource sets the plugin request status source for the context.
Types ¶
type StatusSource ¶
type StatusSource string
StatusSource is an enum-like string value representing the source of a plugin query data response status code
const ( StatusSourcePlugin StatusSource = "plugin" StatusSourceDownstream StatusSource = "downstream" )
const DefaultStatusSource StatusSource = StatusSourcePlugin
DefaultStatusSource is the default StatusSource that should be used when it is not explicitly set by the plugin.
func StatusSourceFromContext ¶
func StatusSourceFromContext(ctx context.Context) StatusSource
StatusSourceFromContext returns the plugin request status source stored in the context. If no plugin request status source is stored in the context, DefaultStatusSource is returned.
func StatusSourceFromPluginErrorSource ¶
func StatusSourceFromPluginErrorSource(pluginErrorSource backend.ErrorSource) StatusSource
StatusSourceFromPluginErrorSource takes an error source returned by a plugin and returns the corresponding StatusSource. If the provided value is a zero-value (i.e.: the plugin did not set it), the function returns DefaultStatusSource.