sqlchannel

package
v0.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMapKeyFromRequest

func GetMapKeyFromRequest(req *dapr.InvokeBindingRequest) string

func SetMockClient

func SetMockClient(cli Client, err error)

func UnsetMockClient

func UnsetMockClient()

Types

type Client

type Client interface {
	JoinMember(ctx context.Context) error
	LeaveMember(ctx context.Context) error
}

func NewClient

func NewClient(characterType string, pod corev1.Pod) (Client, error)

type OperationClient

type OperationClient struct {
	dapr.Client
	CharacterType string

	CacheTTL         time.Duration
	ReconcileTimeout time.Duration
	RequestTimeout   time.Duration
	// contains filtered or unexported fields
}

func NewClientWithPod

func NewClientWithPod(pod *corev1.Pod, characterType string) (*OperationClient, error)

func (*OperationClient) GetRole

func (cli *OperationClient) GetRole() (string, error)

func (*OperationClient) GetSystemAccounts added in v0.6.0

func (cli *OperationClient) GetSystemAccounts() ([]string, error)

GetSystemAccounts lists all system accounts created

func (*OperationClient) InvokeComponent

func (cli *OperationClient) InvokeComponent(ctxWithReconcileTimeout context.Context, req *dapr.InvokeBindingRequest, ch chan *OperationResult)

func (*OperationClient) InvokeComponentInRoutine

func (cli *OperationClient) InvokeComponentInRoutine(ctxWithReconcileTimeout context.Context, req *dapr.InvokeBindingRequest) (*dapr.BindingEvent, error)

func (*OperationClient) JoinMember

func (cli *OperationClient) JoinMember(ctx context.Context) error

func (*OperationClient) LeaveMember

func (cli *OperationClient) LeaveMember(ctx context.Context) error

type OperationHTTPClient

type OperationHTTPClient struct {
	RequestTimeout time.Duration
	// contains filtered or unexported fields
}

OperationHTTPClient is a mock client for operation, mainly used to hide curl command details.

func NewHTTPClientWithChannelPod

func NewHTTPClientWithChannelPod(pod *corev1.Pod, characterType string) (*OperationHTTPClient, error)

NewHTTPClientWithChannelPod create a new OperationHTTPClient with sqlchannel container

func (*OperationHTTPClient) SendRequest

func (cli *OperationHTTPClient) SendRequest(exec *exec.ExecOptions, request SQLChannelRequest) (SQLChannelResponse, error)

SendRequest execs sql operation, this is a blocking operation and use pod EXEC subresource to send a http request to the probed pod

type OperationResult

type OperationResult struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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