Documentation ¶
Index ¶
- func GetMapKeyFromRequest(req *http.Request) string
- func SetMockClient(cli Client, err error)
- func UnsetMockClient()
- type Client
- type OperationClient
- func (cli *OperationClient) GetRole() (string, error)
- func (cli *OperationClient) GetSystemAccounts() ([]string, error)
- func (cli *OperationClient) InvokeComponent(ctxWithReconcileTimeout context.Context, url, method string, body io.Reader, ...)
- func (cli *OperationClient) InvokeComponentInRoutine(ctxWithReconcileTimeout context.Context, url, method string, body io.Reader) (*http.Response, error)
- func (cli *OperationClient) JoinMember(ctx context.Context) error
- func (cli *OperationClient) LeaveMember(ctx context.Context) error
- func (cli *OperationClient) Request(ctx context.Context, operation string) (map[string]any, error)
- type OperationHTTPClient
- type OperationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMapKeyFromRequest ¶
func SetMockClient ¶
func UnsetMockClient ¶
func UnsetMockClient()
Types ¶
type Client ¶
type Client interface { // JoinMember sends a join member operation request to Lorry, located on the target pod that is about to join. JoinMember(ctx context.Context) error // LeaveMember sends a Leave member operation request to Lorry, located on the target pod that is about to leave. LeaveMember(ctx context.Context) error }
type OperationClient ¶
type OperationClient struct { Client *http.Client Port int32 CharacterType string URL 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 ¶
func (cli *OperationClient) GetSystemAccounts() ([]string, error)
GetSystemAccounts lists all system accounts created
func (*OperationClient) InvokeComponent ¶
func (cli *OperationClient) InvokeComponent(ctxWithReconcileTimeout context.Context, url, method string, body io.Reader, ch chan *OperationResult)
func (*OperationClient) InvokeComponentInRoutine ¶
func (*OperationClient) JoinMember ¶
func (cli *OperationClient) JoinMember(ctx context.Context) error
JoinMember sends a join member operation request to Lorry, located on the target pod that is about to join.
func (*OperationClient) LeaveMember ¶
func (cli *OperationClient) LeaveMember(ctx context.Context) error
LeaveMember sends a Leave member operation request to Lorry, located on the target pod that is about to leave.
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
}
Click to show internal directories.
Click to hide internal directories.