backend

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OAuthIdentityTokenHeaderName = "Authorization"

	OAuthIdentityIDTokenHeaderName = "X-Id-Token"

	CookiesHeaderName = "Cookie"
)

Variables

This section is empty.

Functions

func Serve

func Serve(opts ServeOpts)

func StandaloneServe

func StandaloneServe(dsopts ServeOpts, address string) error

Types

type AppInstanceSettings

type AppInstanceSettings struct {
	JSONData json.RawMessage

	DecryptedSecureJSONData map[string]string

	Updated time.Time
}

type CallResourceHandler

type CallResourceHandler interface {
	CallResource(ctx context.Context, req *CallResourceRequest, sender CallResourceResponseSender) error
}

type CallResourceHandlerFunc

type CallResourceHandlerFunc func(ctx context.Context, req *CallResourceRequest, sender CallResourceResponseSender) error

func (CallResourceHandlerFunc) CallResource

type CallResourceRequest

type CallResourceRequest struct {
	PluginContext PluginContext
	Path          string
	Method        string
	URL           string
	Headers       map[string][]string
	Body          []byte
}

type CallResourceResponse

type CallResourceResponse struct {
	Status  int
	Headers map[string][]string
	Body    []byte
}

type CallResourceResponseSender

type CallResourceResponseSender interface {
	Send(*CallResourceResponse) error
}

type CheckHealthHandler

type CheckHealthHandler interface {
	CheckHealth(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error)
}

type CheckHealthHandlerFunc

type CheckHealthHandlerFunc func(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error)

func (CheckHealthHandlerFunc) CheckHealth

type CheckHealthRequest

type CheckHealthRequest struct {
	PluginContext PluginContext

	Headers map[string]string
}

func (*CheckHealthRequest) DeleteHTTPHeader

func (req *CheckHealthRequest) DeleteHTTPHeader(key string)

func (*CheckHealthRequest) GetHTTPHeader

func (req *CheckHealthRequest) GetHTTPHeader(key string) string

func (*CheckHealthRequest) GetHTTPHeaders

func (req *CheckHealthRequest) GetHTTPHeaders() http.Header

func (*CheckHealthRequest) SetHTTPHeader

func (req *CheckHealthRequest) SetHTTPHeader(key, value string)

type CheckHealthResult

type CheckHealthResult struct {
	Status HealthStatus

	Message string

	JSONDetails []byte
}

type ConvertFromProtobuf

type ConvertFromProtobuf struct{}

func FromProto

func FromProto() ConvertFromProtobuf

func (ConvertFromProtobuf) AppInstanceSettings

func (ConvertFromProtobuf) CallResourceRequest

func (f ConvertFromProtobuf) CallResourceRequest(protoReq *pluginv2.CallResourceRequest) *CallResourceRequest

func (ConvertFromProtobuf) CallResourceResponse

func (f ConvertFromProtobuf) CallResourceResponse(protoResp *pluginv2.CallResourceResponse) *CallResourceResponse

func (ConvertFromProtobuf) CheckHealthRequest

func (f ConvertFromProtobuf) CheckHealthRequest(protoReq *pluginv2.CheckHealthRequest) *CheckHealthRequest

func (ConvertFromProtobuf) CheckHealthResponse

func (f ConvertFromProtobuf) CheckHealthResponse(protoResp *pluginv2.CheckHealthResponse) *CheckHealthResult

func (ConvertFromProtobuf) DataSourceInstanceSettings

func (f ConvertFromProtobuf) DataSourceInstanceSettings(proto *pluginv2.DataSourceInstanceSettings, pluginID string) *DataSourceInstanceSettings

func (ConvertFromProtobuf) PluginContext

func (f ConvertFromProtobuf) PluginContext(proto *pluginv2.PluginContext) PluginContext

func (ConvertFromProtobuf) PluginInfoGetReq

func (f ConvertFromProtobuf) PluginInfoGetReq(protoReq *pluginv2.PluginInfoGetReq) *PluginInfoGetReq

func (ConvertFromProtobuf) PluginInfoGetRes

func (f ConvertFromProtobuf) PluginInfoGetRes(protoResp *pluginv2.PluginInfoGetRes) *PluginInfoGetRes

func (ConvertFromProtobuf) User

func (f ConvertFromProtobuf) User(user *pluginv2.User) *User

type ConvertToProtobuf

type ConvertToProtobuf struct{}

func ToProto

func ToProto() ConvertToProtobuf

func (ConvertToProtobuf) AppInstanceSettings

func (ConvertToProtobuf) CallResourceRequest

func (ConvertToProtobuf) CallResourceResponse

func (ConvertToProtobuf) CheckHealthResponse

func (t ConvertToProtobuf) CheckHealthResponse(res *CheckHealthResult) *pluginv2.CheckHealthResponse

func (ConvertToProtobuf) DataSourceInstanceSettings

func (ConvertToProtobuf) HealthStatus

func (ConvertToProtobuf) PluginContext

func (t ConvertToProtobuf) PluginContext(pluginCtx PluginContext) *pluginv2.PluginContext

func (ConvertToProtobuf) PluginInfoGetRes

func (f ConvertToProtobuf) PluginInfoGetRes(protoResp *PluginInfoGetRes) *pluginv2.PluginInfoGetRes

func (ConvertToProtobuf) User

func (t ConvertToProtobuf) User(user *User) *pluginv2.User

type DataSourceInstanceSettings

type DataSourceInstanceSettings struct {
	ID int64

	UID string

	Type string

	Name string

	URL string

	User string

	Database string

	BasicAuthEnabled bool

	BasicAuthUser string

	JSONData json.RawMessage

	DecryptedSecureJSONData map[string]string

	Updated time.Time
}

type DefaultPluginInfoHandler

type DefaultPluginInfoHandler struct {
	PluginID      string
	PluginVersion string
}

func NewDefaultPluginInfoHandler

func NewDefaultPluginInfoHandler(pluginID string, pluginVersion string) *DefaultPluginInfoHandler

func (DefaultPluginInfoHandler) PluginInfo

type ForwardHTTPHeaders

type ForwardHTTPHeaders interface {
	SetHTTPHeader(key, value string)

	DeleteHTTPHeader(key string)

	GetHTTPHeader(key string) string

	GetHTTPHeaders() http.Header
}

type GRPCSettings

type GRPCSettings struct {
	MaxReceiveMsgSize int

	MaxSendMsgSize int
}

type HealthStatus

type HealthStatus int
const (
	HealthStatusUnknown HealthStatus = iota

	HealthStatusOk

	HealthStatusError
)

func (HealthStatus) String

func (hs HealthStatus) String() string

type PluginContext

type PluginContext struct {
	OrgID int64

	PluginID string

	User *User

	AppInstanceSettings *AppInstanceSettings

	DataSourceInstanceSettings *DataSourceInstanceSettings
}

type PluginInfoGetReq

type PluginInfoGetReq struct {
	PluginContext PluginContext
}

type PluginInfoGetRes

type PluginInfoGetRes struct {
	PluginID      string
	PluginVersion string
}

type PluginInfoHandler

type PluginInfoHandler interface {
	PluginInfo(ctx context.Context, req *PluginInfoGetReq) (*PluginInfoGetRes, error)
}

type PluginInfoHandlerFunc

type PluginInfoHandlerFunc func(ctx context.Context, req *PluginInfoGetReq) (*PluginInfoGetRes, error)

func (PluginInfoHandlerFunc) PluginInfo

type ServeOpts

type ServeOpts struct {
	PluginJson *build.PluginJsonData

	CheckHealthHandler CheckHealthHandler

	PluginInfoHandler PluginInfoHandler

	CallResourceHandler CallResourceHandler

	GRPCSettings GRPCSettings

	EvRpcPort string

	ExitCallback func()
	// contains filtered or unexported fields
}

type User

type User struct {
	Login string
	Name  string
	Email string
	Role  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL