dtstruct

package
v0.0.0-...-6b32d26 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 16

Documentation

Overview

Copyright 2021 SANGFOR TECHNOLOGIES

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionType_name = map[int32]string{
		0:  "FAILOVER",
		1:  "SWITCHOVER",
		10: "START",
		11: "START_BY_PRIMARY",
		12: "START_BY_STANDBY",
		13: "START_BY_CASCADE",
		14: "START_BY_PENDING",
		15: "START_CLUSTER",
		20: "STOP",
		23: "RESTART",
		30: "BUILD",
		31: "BUILD_BY_PRIMARY",
		32: "BUILD_BY_STANDBY",
		33: "BUILD_BY_CASCADE",
	}
	ActionType_value = map[string]int32{
		"FAILOVER":         0,
		"SWITCHOVER":       1,
		"START":            10,
		"START_BY_PRIMARY": 11,
		"START_BY_STANDBY": 12,
		"START_BY_CASCADE": 13,
		"START_BY_PENDING": 14,
		"START_CLUSTER":    15,
		"STOP":             20,
		"RESTART":          23,
		"BUILD":            30,
		"BUILD_BY_PRIMARY": 31,
		"BUILD_BY_STANDBY": 32,
		"BUILD_BY_CASCADE": 33,
	}
)

Enum value maps for ActionType.

View Source
var File_agent_proto protoreflect.FileDescriptor

Functions

func RegisterOpengaussAgentServer

func RegisterOpengaussAgentServer(s *grpc.Server, srv OpengaussAgentServer)

Types

type ActionType

type ActionType int32

ActionType all action type supported now

const (
	ActionType_FAILOVER         ActionType = 0
	ActionType_SWITCHOVER       ActionType = 1
	ActionType_START            ActionType = 10
	ActionType_START_BY_PRIMARY ActionType = 11
	ActionType_START_BY_STANDBY ActionType = 12
	ActionType_START_BY_CASCADE ActionType = 13
	ActionType_START_BY_PENDING ActionType = 14
	ActionType_START_CLUSTER    ActionType = 15
	ActionType_STOP             ActionType = 20
	ActionType_RESTART          ActionType = 23
	ActionType_BUILD            ActionType = 30
	ActionType_BUILD_BY_PRIMARY ActionType = 31
	ActionType_BUILD_BY_STANDBY ActionType = 32
	ActionType_BUILD_BY_CASCADE ActionType = 33
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

func (ActionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type BaseInfo

type BaseInfo struct {
	NodeName      string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	NodeIp        string `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
	DataPath      string `protobuf:"bytes,5,opt,name=data_path,json=dataPath,proto3" json:"data_path,omitempty"`
	DatanodePort  int32  `protobuf:"varint,6,opt,name=datanode_port,json=datanodePort,proto3" json:"datanode_port,omitempty"`
	InstanceId    string `protobuf:"bytes,10,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	InstanceRole  string `protobuf:"bytes,11,opt,name=instance_role,json=instanceRole,proto3" json:"instance_role,omitempty"`
	InstanceState string `protobuf:"bytes,12,opt,name=instance_state,json=instanceState,proto3" json:"instance_state,omitempty"`
	HaState       string `protobuf:"bytes,13,opt,name=ha_state,json=haState,proto3" json:"ha_state,omitempty"`
	GaussVersion  string `protobuf:"bytes,20,opt,name=gauss_version,json=gaussVersion,proto3" json:"gauss_version,omitempty"`
	GsClusterName string `protobuf:"bytes,30,opt,name=gs_cluster_name,json=gsClusterName,proto3" json:"gs_cluster_name,omitempty"`
	// contains filtered or unexported fields
}

BaseInfo instance basic info

func (*BaseInfo) Descriptor deprecated

func (*BaseInfo) Descriptor() ([]byte, []int)

Deprecated: Use BaseInfo.ProtoReflect.Descriptor instead.

func (*BaseInfo) GetDataPath

func (x *BaseInfo) GetDataPath() string

func (*BaseInfo) GetDatanodePort

func (x *BaseInfo) GetDatanodePort() int32

func (*BaseInfo) GetGaussVersion

func (x *BaseInfo) GetGaussVersion() string

func (*BaseInfo) GetGsClusterName

func (x *BaseInfo) GetGsClusterName() string

func (*BaseInfo) GetHaState

func (x *BaseInfo) GetHaState() string

func (*BaseInfo) GetInstanceId

func (x *BaseInfo) GetInstanceId() string

func (*BaseInfo) GetInstanceRole

func (x *BaseInfo) GetInstanceRole() string

func (*BaseInfo) GetInstanceState

func (x *BaseInfo) GetInstanceState() string

func (*BaseInfo) GetNodeIp

func (x *BaseInfo) GetNodeIp() string

func (*BaseInfo) GetNodeName

func (x *BaseInfo) GetNodeName() string

func (*BaseInfo) ProtoMessage

func (*BaseInfo) ProtoMessage()

func (*BaseInfo) ProtoReflect

func (x *BaseInfo) ProtoReflect() protoreflect.Message

func (*BaseInfo) Reset

func (x *BaseInfo) Reset()

func (*BaseInfo) String

func (x *BaseInfo) String() string

type DatabaseInfoRequest

type DatabaseInfoRequest struct {
	FromCache bool `protobuf:"varint,1,opt,name=from_cache,json=fromCache,proto3" json:"from_cache,omitempty"` // get info from cache or not
	// contains filtered or unexported fields
}

DatabaseInfoRequest used in CollectInfo rpc

func (*DatabaseInfoRequest) Descriptor deprecated

func (*DatabaseInfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseInfoRequest.ProtoReflect.Descriptor instead.

func (*DatabaseInfoRequest) GetFromCache

func (x *DatabaseInfoRequest) GetFromCache() bool

func (*DatabaseInfoRequest) ProtoMessage

func (*DatabaseInfoRequest) ProtoMessage()

func (*DatabaseInfoRequest) ProtoReflect

func (x *DatabaseInfoRequest) ProtoReflect() protoreflect.Message

func (*DatabaseInfoRequest) Reset

func (x *DatabaseInfoRequest) Reset()

func (*DatabaseInfoRequest) String

func (x *DatabaseInfoRequest) String() string

type DatabaseInfoResponse

type DatabaseInfoResponse struct {
	NodeInfo *NodeInfo `protobuf:"bytes,1,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"`
	// contains filtered or unexported fields
}

DatabaseInfoResponse used as CollectInfo rpc response

func (*DatabaseInfoResponse) Descriptor deprecated

func (*DatabaseInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseInfoResponse.ProtoReflect.Descriptor instead.

func (*DatabaseInfoResponse) GetNodeInfo

func (x *DatabaseInfoResponse) GetNodeInfo() *NodeInfo

func (*DatabaseInfoResponse) ProtoMessage

func (*DatabaseInfoResponse) ProtoMessage()

func (*DatabaseInfoResponse) ProtoReflect

func (x *DatabaseInfoResponse) ProtoReflect() protoreflect.Message

func (*DatabaseInfoResponse) Reset

func (x *DatabaseInfoResponse) Reset()

func (*DatabaseInfoResponse) String

func (x *DatabaseInfoResponse) String() string

type HookFunction

type HookFunction func(command string, args ...string) ([]string, error)

type ManageActionRequest

type ManageActionRequest struct {
	ActionType ActionType `protobuf:"varint,1,opt,name=action_type,json=actionType,proto3,enum=dtstruct.ActionType" json:"action_type,omitempty"`
	// contains filtered or unexported fields
}

ManageActionRequest used in ManageAction rpc

func (*ManageActionRequest) Descriptor deprecated

func (*ManageActionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ManageActionRequest.ProtoReflect.Descriptor instead.

func (*ManageActionRequest) GetActionType

func (x *ManageActionRequest) GetActionType() ActionType

func (*ManageActionRequest) ProtoMessage

func (*ManageActionRequest) ProtoMessage()

func (*ManageActionRequest) ProtoReflect

func (x *ManageActionRequest) ProtoReflect() protoreflect.Message

func (*ManageActionRequest) Reset

func (x *ManageActionRequest) Reset()

func (*ManageActionRequest) String

func (x *ManageActionRequest) String() string

type ManageActionResponse

type ManageActionResponse struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

ManageActionResponse used as ManageAction rpc response

func (*ManageActionResponse) Descriptor deprecated

func (*ManageActionResponse) Descriptor() ([]byte, []int)

Deprecated: Use ManageActionResponse.ProtoReflect.Descriptor instead.

func (*ManageActionResponse) GetData

func (x *ManageActionResponse) GetData() string

func (*ManageActionResponse) ProtoMessage

func (*ManageActionResponse) ProtoMessage()

func (*ManageActionResponse) ProtoReflect

func (x *ManageActionResponse) ProtoReflect() protoreflect.Message

func (*ManageActionResponse) Reset

func (x *ManageActionResponse) Reset()

func (*ManageActionResponse) String

func (x *ManageActionResponse) String() string

type NodeInfo

type NodeInfo struct {
	BaseInfo       *BaseInfo   `protobuf:"bytes,1,opt,name=base_info,json=baseInfo,proto3" json:"base_info,omitempty"`
	SyncInfo       *SyncInfo   `protobuf:"bytes,2,opt,name=sync_info,json=syncInfo,proto3" json:"sync_info,omitempty"`
	Upstream       *BaseInfo   `protobuf:"bytes,3,opt,name=upstream,proto3" json:"upstream,omitempty"`
	DownstreamList []*BaseInfo `protobuf:"bytes,4,rep,name=downstream_list,json=downstreamList,proto3" json:"downstream_list,omitempty"`
	// contains filtered or unexported fields
}

node info include basic and sync

func (*NodeInfo) Descriptor deprecated

func (*NodeInfo) Descriptor() ([]byte, []int)

Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead.

func (*NodeInfo) GetBaseInfo

func (x *NodeInfo) GetBaseInfo() *BaseInfo

func (*NodeInfo) GetDownstreamList

func (x *NodeInfo) GetDownstreamList() []*BaseInfo

func (*NodeInfo) GetSyncInfo

func (x *NodeInfo) GetSyncInfo() *SyncInfo

func (*NodeInfo) GetUpstream

func (x *NodeInfo) GetUpstream() *BaseInfo

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) ProtoReflect

func (x *NodeInfo) ProtoReflect() protoreflect.Message

func (*NodeInfo) Reset

func (x *NodeInfo) Reset()

func (*NodeInfo) String

func (x *NodeInfo) String() string

type OpengaussAgentClient

type OpengaussAgentClient interface {
	// collect opengauss base info
	CollectInfo(ctx context.Context, in *DatabaseInfoRequest, opts ...grpc.CallOption) (*DatabaseInfoResponse, error)
	// manage opengauss, such as start/stop/build...
	ManageAction(ctx context.Context, in *ManageActionRequest, opts ...grpc.CallOption) (*ManageActionResponse, error)
	// update opengauss sync config
	UpdateSyncConfig(ctx context.Context, in *UpdateSyncConfigRequest, opts ...grpc.CallOption) (*UpdateSyncConfigResponse, error)
	// update opengauss sync config
	ReplicationConfirm(ctx context.Context, in *ReplicationConfirmRequest, opts ...grpc.CallOption) (*ReplicationConfirmResponse, error)
}

OpengaussAgentClient is the client API for OpengaussAgent service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type OpengaussAgentServer

type OpengaussAgentServer interface {
	// collect opengauss base info
	CollectInfo(context.Context, *DatabaseInfoRequest) (*DatabaseInfoResponse, error)
	// manage opengauss, such as start/stop/build...
	ManageAction(context.Context, *ManageActionRequest) (*ManageActionResponse, error)
	// update opengauss sync config
	UpdateSyncConfig(context.Context, *UpdateSyncConfigRequest) (*UpdateSyncConfigResponse, error)
	// update opengauss sync config
	ReplicationConfirm(context.Context, *ReplicationConfirmRequest) (*ReplicationConfirmResponse, error)
}

OpengaussAgentServer is the server API for OpengaussAgent service.

type ReplicationConfirmRequest

type ReplicationConfirmRequest struct {
	ConfirmNodename string `protobuf:"bytes,1,opt,name=confirm_nodename,json=confirmNodename,proto3" json:"confirm_nodename,omitempty"` // nodename of replication peer
	Upstream        bool   `protobuf:"varint,2,opt,name=upstream,proto3" json:"upstream,omitempty"`                                     // upstream or downstream
	// contains filtered or unexported fields
}

ReplicationConfirmRequest used for ReplicationConfirm rpc

func (*ReplicationConfirmRequest) Descriptor deprecated

func (*ReplicationConfirmRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReplicationConfirmRequest.ProtoReflect.Descriptor instead.

func (*ReplicationConfirmRequest) GetConfirmNodename

func (x *ReplicationConfirmRequest) GetConfirmNodename() string

func (*ReplicationConfirmRequest) GetUpstream

func (x *ReplicationConfirmRequest) GetUpstream() bool

func (*ReplicationConfirmRequest) ProtoMessage

func (*ReplicationConfirmRequest) ProtoMessage()

func (*ReplicationConfirmRequest) ProtoReflect

func (*ReplicationConfirmRequest) Reset

func (x *ReplicationConfirmRequest) Reset()

func (*ReplicationConfirmRequest) String

func (x *ReplicationConfirmRequest) String() string

type ReplicationConfirmResponse

type ReplicationConfirmResponse struct {
	Normal bool `protobuf:"varint,1,opt,name=normal,proto3" json:"normal,omitempty"` // replication is normal or not
	// contains filtered or unexported fields
}

ReplicationConfirmResponse used as ReplicationConfirm rpc response

func (*ReplicationConfirmResponse) Descriptor deprecated

func (*ReplicationConfirmResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReplicationConfirmResponse.ProtoReflect.Descriptor instead.

func (*ReplicationConfirmResponse) GetNormal

func (x *ReplicationConfirmResponse) GetNormal() bool

func (*ReplicationConfirmResponse) ProtoMessage

func (*ReplicationConfirmResponse) ProtoMessage()

func (*ReplicationConfirmResponse) ProtoReflect

func (*ReplicationConfirmResponse) Reset

func (x *ReplicationConfirmResponse) Reset()

func (*ReplicationConfirmResponse) String

func (x *ReplicationConfirmResponse) String() string

type SyncInfo

type SyncInfo struct {
	LocalRole                string `protobuf:"bytes,1,opt,name=local_role,json=localRole,proto3" json:"local_role,omitempty"`
	State                    string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	SenderSentLocation       string `protobuf:"bytes,10,opt,name=sender_sent_location,json=senderSentLocation,proto3" json:"sender_sent_location,omitempty"`
	SenderWriteLocation      string `protobuf:"bytes,11,opt,name=sender_write_location,json=senderWriteLocation,proto3" json:"sender_write_location,omitempty"`
	SenderFlushLocation      string `protobuf:"bytes,12,opt,name=sender_flush_location,json=senderFlushLocation,proto3" json:"sender_flush_location,omitempty"`
	SenderReplayLocation     string `protobuf:"bytes,13,opt,name=sender_replay_location,json=senderReplayLocation,proto3" json:"sender_replay_location,omitempty"`
	ReceiverReceivedLocation string `` /* 136-byte string literal not displayed */
	ReceiverWriteLocation    string `` /* 127-byte string literal not displayed */
	ReceiverFlushLocation    string `` /* 127-byte string literal not displayed */
	ReceiverReplayLocation   string `` /* 130-byte string literal not displayed */
	SyncPercent              int32  `protobuf:"varint,30,opt,name=sync_percent,json=syncPercent,proto3" json:"sync_percent,omitempty"`
	SyncState                string `protobuf:"bytes,31,opt,name=sync_state,json=syncState,proto3" json:"sync_state,omitempty"`
	SyncMode                 string `protobuf:"bytes,32,opt,name=sync_mode,json=syncMode,proto3" json:"sync_mode,omitempty"`
	Channel                  string `protobuf:"bytes,50,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

node sync info

func (*SyncInfo) Descriptor deprecated

func (*SyncInfo) Descriptor() ([]byte, []int)

Deprecated: Use SyncInfo.ProtoReflect.Descriptor instead.

func (*SyncInfo) GetChannel

func (x *SyncInfo) GetChannel() string

func (*SyncInfo) GetLocalRole

func (x *SyncInfo) GetLocalRole() string

func (*SyncInfo) GetReceiverFlushLocation

func (x *SyncInfo) GetReceiverFlushLocation() string

func (*SyncInfo) GetReceiverReceivedLocation

func (x *SyncInfo) GetReceiverReceivedLocation() string

func (*SyncInfo) GetReceiverReplayLocation

func (x *SyncInfo) GetReceiverReplayLocation() string

func (*SyncInfo) GetReceiverWriteLocation

func (x *SyncInfo) GetReceiverWriteLocation() string

func (*SyncInfo) GetSenderFlushLocation

func (x *SyncInfo) GetSenderFlushLocation() string

func (*SyncInfo) GetSenderReplayLocation

func (x *SyncInfo) GetSenderReplayLocation() string

func (*SyncInfo) GetSenderSentLocation

func (x *SyncInfo) GetSenderSentLocation() string

func (*SyncInfo) GetSenderWriteLocation

func (x *SyncInfo) GetSenderWriteLocation() string

func (*SyncInfo) GetState

func (x *SyncInfo) GetState() string

func (*SyncInfo) GetSyncMode

func (x *SyncInfo) GetSyncMode() string

func (*SyncInfo) GetSyncPercent

func (x *SyncInfo) GetSyncPercent() int32

func (*SyncInfo) GetSyncState

func (x *SyncInfo) GetSyncState() string

func (*SyncInfo) ProtoMessage

func (*SyncInfo) ProtoMessage()

func (*SyncInfo) ProtoReflect

func (x *SyncInfo) ProtoReflect() protoreflect.Message

func (*SyncInfo) Reset

func (x *SyncInfo) Reset()

func (*SyncInfo) String

func (x *SyncInfo) String() string

type UnimplementedOpengaussAgentServer

type UnimplementedOpengaussAgentServer struct {
}

UnimplementedOpengaussAgentServer can be embedded to have forward compatible implementations.

func (*UnimplementedOpengaussAgentServer) CollectInfo

func (*UnimplementedOpengaussAgentServer) ManageAction

func (*UnimplementedOpengaussAgentServer) ReplicationConfirm

func (*UnimplementedOpengaussAgentServer) UpdateSyncConfig

type UpdateSyncConfigRequest

type UpdateSyncConfigRequest struct {
	SyncConf string `protobuf:"bytes,1,opt,name=sync_conf,json=syncConf,proto3" json:"sync_conf,omitempty"` // sync config
	// contains filtered or unexported fields
}

UpdateSyncConfigRequest used for UpdateSyncConfig rpc

func (*UpdateSyncConfigRequest) Descriptor deprecated

func (*UpdateSyncConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateSyncConfigRequest.ProtoReflect.Descriptor instead.

func (*UpdateSyncConfigRequest) GetSyncConf

func (x *UpdateSyncConfigRequest) GetSyncConf() string

func (*UpdateSyncConfigRequest) ProtoMessage

func (*UpdateSyncConfigRequest) ProtoMessage()

func (*UpdateSyncConfigRequest) ProtoReflect

func (x *UpdateSyncConfigRequest) ProtoReflect() protoreflect.Message

func (*UpdateSyncConfigRequest) Reset

func (x *UpdateSyncConfigRequest) Reset()

func (*UpdateSyncConfigRequest) String

func (x *UpdateSyncConfigRequest) String() string

type UpdateSyncConfigResponse

type UpdateSyncConfigResponse struct {
	SyncStandby string `protobuf:"bytes,1,opt,name=sync_standby,json=syncStandby,proto3" json:"sync_standby,omitempty"` // cluster sync config currently
	// contains filtered or unexported fields
}

UpdateSyncConfigResponse used as UpdateSyncConfig rpc response

func (*UpdateSyncConfigResponse) Descriptor deprecated

func (*UpdateSyncConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateSyncConfigResponse.ProtoReflect.Descriptor instead.

func (*UpdateSyncConfigResponse) GetSyncStandby

func (x *UpdateSyncConfigResponse) GetSyncStandby() string

func (*UpdateSyncConfigResponse) ProtoMessage

func (*UpdateSyncConfigResponse) ProtoMessage()

func (*UpdateSyncConfigResponse) ProtoReflect

func (x *UpdateSyncConfigResponse) ProtoReflect() protoreflect.Message

func (*UpdateSyncConfigResponse) Reset

func (x *UpdateSyncConfigResponse) Reset()

func (*UpdateSyncConfigResponse) String

func (x *UpdateSyncConfigResponse) String() string

Jump to

Keyboard shortcuts

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