mongodb

package
v0.0.0-...-7aae7b9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "mongodb"
)

Variables

View Source
var (
	STATUS_name = map[int32]string{
		0:  "UNKNOW",
		5:  "PENDING",
		6:  "CREATE_FAILED",
		11: "RUNNING",
		20: "MODIFYING",
		30: "REBOOTING",
		31: "RESTORING",
		32: "TRANSING",
		33: "IMPORTING",
		34: "CLONING",
		35: "UPGRADING",
		36: "BACKING_UP",
		37: "NET_CHANGING",
		40: "SWITCHOVER",
		41: "GUARD_CREATING",
		50: "ERROR",
		51: "STORAGE_FULL",
		70: "LOCKED",
		71: "ISOLATIONING",
		72: "ISOLATIONED",
		80: "SHUTDOWN",
		81: "DELETING",
		90: "DESTROYED",
	}
	STATUS_value = map[string]int32{
		"UNKNOW":         0,
		"PENDING":        5,
		"CREATE_FAILED":  6,
		"RUNNING":        11,
		"MODIFYING":      20,
		"REBOOTING":      30,
		"RESTORING":      31,
		"TRANSING":       32,
		"IMPORTING":      33,
		"CLONING":        34,
		"UPGRADING":      35,
		"BACKING_UP":     36,
		"NET_CHANGING":   37,
		"SWITCHOVER":     40,
		"GUARD_CREATING": 41,
		"ERROR":          50,
		"STORAGE_FULL":   51,
		"LOCKED":         70,
		"ISOLATIONING":   71,
		"ISOLATIONED":    72,
		"SHUTDOWN":       80,
		"DELETING":       81,
		"DESTROYED":      90,
	}
)

Enum value maps for STATUS.

View Source
var File_apps_mongodb_pb_mongodb_proto protoreflect.FileDescriptor
View Source
var File_apps_mongodb_pb_rpc_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "infraboard.cmdb.mongodb.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SyncMongoDB",
			Handler:    _Service_SyncMongoDB_Handler,
		},
		{
			MethodName: "QueryMongoDB",
			Handler:    _Service_QueryMongoDB_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/mongodb/pb/rpc.proto",
}

Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type Describe

type Describe struct {

	// 数据库引擎
	// @gotags: json:"engine"
	Engine string `protobuf:"bytes,1,opt,name=engine,proto3" json:"engine"`
	// 存储类型
	// @gotags: json:"storage_type"
	StorageType string `protobuf:"bytes,2,opt,name=storage_type,json=storageType,proto3" json:"storage_type"`
	// 数据库版本号
	// @gotags: json:"engine_version"
	EngineVersion string `protobuf:"bytes,3,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version"`
	// Mongos节点的最大连接数
	// @gotags: json:"max_connections"
	MaxConnections int32 `protobuf:"varint,4,opt,name=max_connections,json=maxConnections,proto3" json:"max_connections"`
	// 实例最大IOPS
	// @gotags: json:"max_iops"
	MaxIops int32 `protobuf:"varint,5,opt,name=max_iops,json=maxIops,proto3" json:"max_iops"`
	// contains filtered or unexported fields
}

func (*Describe) Descriptor deprecated

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

Deprecated: Use Describe.ProtoReflect.Descriptor instead.

func (*Describe) GetEngine

func (x *Describe) GetEngine() string

func (*Describe) GetEngineVersion

func (x *Describe) GetEngineVersion() string

func (*Describe) GetMaxConnections

func (x *Describe) GetMaxConnections() int32

func (*Describe) GetMaxIops

func (x *Describe) GetMaxIops() int32

func (*Describe) GetStorageType

func (x *Describe) GetStorageType() string

func (*Describe) ProtoMessage

func (*Describe) ProtoMessage()

func (*Describe) ProtoReflect

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

func (*Describe) Reset

func (x *Describe) Reset()

func (*Describe) String

func (x *Describe) String() string

type MongoDB

type MongoDB struct {

	// @gotags: json:"resource"
	Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"`
	// @gotags: json:"describe"
	Describe *Describe `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe"`
	// contains filtered or unexported fields
}

func NewDefaultMongoDB

func NewDefaultMongoDB() *MongoDB

func (*MongoDB) Descriptor deprecated

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

Deprecated: Use MongoDB.ProtoReflect.Descriptor instead.

func (*MongoDB) GetDescribe

func (x *MongoDB) GetDescribe() *Describe

func (*MongoDB) GetResource

func (x *MongoDB) GetResource() *resource.Resource

func (*MongoDB) ProtoMessage

func (*MongoDB) ProtoMessage()

func (*MongoDB) ProtoReflect

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

func (*MongoDB) Reset

func (x *MongoDB) Reset()

func (*MongoDB) String

func (x *MongoDB) String() string

type MongoDBSet

type MongoDBSet struct {

	// 总数量
	// @gotags: json:"total"
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
	// 列表项
	// @gotags: json:"items"
	Items []*MongoDB `protobuf:"bytes,2,rep,name=items,proto3" json:"items"`
	// contains filtered or unexported fields
}

func NewMongoDBSet

func NewMongoDBSet() *MongoDBSet

func (*MongoDBSet) Add

func (s *MongoDBSet) Add(items ...any)

func (*MongoDBSet) AddSet

func (s *MongoDBSet) AddSet(set *MongoDBSet)

func (*MongoDBSet) Descriptor deprecated

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

Deprecated: Use MongoDBSet.ProtoReflect.Descriptor instead.

func (*MongoDBSet) GetItems

func (x *MongoDBSet) GetItems() []*MongoDB

func (*MongoDBSet) GetTotal

func (x *MongoDBSet) GetTotal() int64

func (*MongoDBSet) Length

func (s *MongoDBSet) Length() int64

func (*MongoDBSet) ProtoMessage

func (*MongoDBSet) ProtoMessage()

func (*MongoDBSet) ProtoReflect

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

func (*MongoDBSet) Reset

func (x *MongoDBSet) Reset()

func (*MongoDBSet) String

func (x *MongoDBSet) String() string

func (*MongoDBSet) ToAny

func (s *MongoDBSet) ToAny() (items []any)

type QueryMongoDBRequest

type QueryMongoDBRequest struct {

	// 分页参数
	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// contains filtered or unexported fields
}

func (*QueryMongoDBRequest) Descriptor deprecated

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

Deprecated: Use QueryMongoDBRequest.ProtoReflect.Descriptor instead.

func (*QueryMongoDBRequest) GetPage

func (x *QueryMongoDBRequest) GetPage() *request.PageRequest

func (*QueryMongoDBRequest) ProtoMessage

func (*QueryMongoDBRequest) ProtoMessage()

func (*QueryMongoDBRequest) ProtoReflect

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

func (*QueryMongoDBRequest) Reset

func (x *QueryMongoDBRequest) Reset()

func (*QueryMongoDBRequest) String

func (x *QueryMongoDBRequest) String() string

type STATUS

type STATUS int32
const (
	// 未知状态
	STATUS_UNKNOW STATUS = 0
	// 表示创建中
	STATUS_PENDING STATUS = 5
	// 表示创建失败
	STATUS_CREATE_FAILED STATUS = 6
	// 表示运行中
	STATUS_RUNNING STATUS = 11
	// 实例配置变更生效中
	STATUS_MODIFYING STATUS = 20
	// 表示重启中
	STATUS_REBOOTING STATUS = 30
	// 备份恢复中
	STATUS_RESTORING STATUS = 31
	// 迁移中
	STATUS_TRANSING STATUS = 32
	// 数据导入中
	STATUS_IMPORTING STATUS = 33
	// 实例克隆中
	STATUS_CLONING STATUS = 34
	// 迁移版本中
	STATUS_UPGRADING STATUS = 35
	// 表示实例正在进行备份
	STATUS_BACKING_UP STATUS = 36
	// 内外网切换中
	STATUS_NET_CHANGING STATUS = 37
	// 表示实例正在主备切换
	STATUS_SWITCHOVER STATUS = 40
	// 灾备实例创建同步中
	STATUS_GUARD_CREATING STATUS = 41
	// 状态异常
	STATUS_ERROR STATUS = 50
	// 表示实例磁盘空间满
	STATUS_STORAGE_FULL STATUS = 51
	// 表示实例已经锁定
	STATUS_LOCKED STATUS = 70
	// 隔离中
	STATUS_ISOLATIONING STATUS = 71
	// 已隔中
	STATUS_ISOLATIONED STATUS = 72
	// 表示停止待销毁
	STATUS_SHUTDOWN STATUS = 80
	// 表示销毁中
	STATUS_DELETING STATUS = 81
	// 已销毁
	STATUS_DESTROYED STATUS = 90
)

func ParseSTATUSFromString

func ParseSTATUSFromString(str string) (STATUS, error)

ParseSTATUSFromString Parse STATUS from string

func (STATUS) Descriptor

func (STATUS) Descriptor() protoreflect.EnumDescriptor

func (STATUS) Enum

func (x STATUS) Enum() *STATUS

func (STATUS) EnumDescriptor deprecated

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

Deprecated: Use STATUS.Descriptor instead.

func (STATUS) Equal

func (t STATUS) Equal(target STATUS) bool

Equal type compare

func (STATUS) IsIn

func (t STATUS) IsIn(targets ...STATUS) bool

IsIn todo

func (STATUS) MarshalJSON

func (t STATUS) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (STATUS) Number

func (x STATUS) Number() protoreflect.EnumNumber

func (STATUS) String

func (x STATUS) String() string

func (STATUS) Type

func (STATUS) Type() protoreflect.EnumType

func (*STATUS) UnmarshalJSON

func (t *STATUS) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

type ServiceClient

type ServiceClient interface {
	SyncMongoDB(ctx context.Context, in *MongoDB, opts ...grpc.CallOption) (*MongoDB, error)
	QueryMongoDB(ctx context.Context, in *QueryMongoDBRequest, opts ...grpc.CallOption) (*MongoDBSet, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	SyncMongoDB(context.Context, *MongoDB) (*MongoDB, error)
	QueryMongoDB(context.Context, *QueryMongoDBRequest) (*MongoDBSet, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) QueryMongoDB

func (UnimplementedServiceServer) SyncMongoDB

type UnsafeServiceServer

type UnsafeServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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