eip

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "eip"
)

Variables

View Source
var (
	STATUS_name = map[int32]string{
		0:  "UNKNOW",
		5:  "PENDING",
		6:  "BINDING",
		7:  "UNBINDING",
		11: "BIND",
		12: "UNBIND",
		50: "ERROR",
		80: "OFFLINING",
		90: "DESTROYED",
	}
	STATUS_value = map[string]int32{
		"UNKNOW":    0,
		"PENDING":   5,
		"BINDING":   6,
		"UNBINDING": 7,
		"BIND":      11,
		"UNBIND":    12,
		"ERROR":     50,
		"OFFLINING": 80,
		"DESTROYED": 90,
	}
)

Enum value maps for STATUS.

View Source
var File_apps_eip_pb_eip_proto protoreflect.FileDescriptor
View Source
var File_apps_eip_pb_rpc_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "infraboard.cmdb.eip.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SyncEIP",
			Handler:    _Service_SyncEIP_Handler,
		},
		{
			MethodName: "QueryEIP",
			Handler:    _Service_QueryEIP_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/eip/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 {

	// BGP
	// @gotags: json:"isp"
	Isp string `protobuf:"bytes,1,opt,name=isp,proto3" json:"isp"`
	// 带宽, 单位M
	// @gotags: json:"band_width"
	BandWidth int64 `protobuf:"varint,2,opt,name=band_width,json=bandWidth,proto3" json:"band_width"`
	// 关联实例ID
	// @gotags: json:"instance_id"
	InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id"`
	// 关联实例类型
	// @gotags: json:"instance_type"
	InstanceType string `protobuf:"bytes,4,opt,name=instance_type,json=instanceType,proto3" json:"instance_type"`
	// 关联实例Region
	// @gotags: json:"instance_region"
	InstanceRegion string `protobuf:"bytes,5,opt,name=instance_region,json=instanceRegion,proto3" json:"instance_region"`
	// 模式(NAT)
	// @gotags: json:"mode"
	Mode string `protobuf:"bytes,6,opt,name=mode,proto3" json:"mode"`
	// contains filtered or unexported fields
}

func (*Describe) Descriptor deprecated

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

Deprecated: Use Describe.ProtoReflect.Descriptor instead.

func (*Describe) GetBandWidth

func (x *Describe) GetBandWidth() int64

func (*Describe) GetInstanceId

func (x *Describe) GetInstanceId() string

func (*Describe) GetInstanceRegion

func (x *Describe) GetInstanceRegion() string

func (*Describe) GetInstanceType

func (x *Describe) GetInstanceType() string

func (*Describe) GetIsp

func (x *Describe) GetIsp() string

func (*Describe) GetMode

func (x *Describe) GetMode() 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 EIP

type EIP struct {

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

func NewDefaultEip

func NewDefaultEip() *EIP

func (*EIP) Descriptor deprecated

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

Deprecated: Use EIP.ProtoReflect.Descriptor instead.

func (*EIP) GetDescribe

func (x *EIP) GetDescribe() *Describe

func (*EIP) GetResource

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

func (*EIP) ProtoMessage

func (*EIP) ProtoMessage()

func (*EIP) ProtoReflect

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

func (*EIP) Reset

func (x *EIP) Reset()

func (*EIP) String

func (x *EIP) String() string

type EIPSet

type EIPSet struct {

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

func NewEIPSet

func NewEIPSet() *EIPSet

func (*EIPSet) Add

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

func (*EIPSet) Descriptor deprecated

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

Deprecated: Use EIPSet.ProtoReflect.Descriptor instead.

func (*EIPSet) GetItems

func (x *EIPSet) GetItems() []*EIP

func (*EIPSet) GetTotal

func (x *EIPSet) GetTotal() int64

func (*EIPSet) Length

func (s *EIPSet) Length() int64

func (*EIPSet) ProtoMessage

func (*EIPSet) ProtoMessage()

func (*EIPSet) ProtoReflect

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

func (*EIPSet) Reset

func (x *EIPSet) Reset()

func (*EIPSet) ResourceIds

func (s *EIPSet) ResourceIds() (ids []string)

func (*EIPSet) String

func (x *EIPSet) String() string

func (*EIPSet) ToAny

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

func (*EIPSet) ToJsonString

func (s *EIPSet) ToJsonString() string

type QueryEIPRequest

type QueryEIPRequest struct {

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

func (*QueryEIPRequest) Descriptor deprecated

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

Deprecated: Use QueryEIPRequest.ProtoReflect.Descriptor instead.

func (*QueryEIPRequest) GetPage

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

func (*QueryEIPRequest) ProtoMessage

func (*QueryEIPRequest) ProtoMessage()

func (*QueryEIPRequest) ProtoReflect

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

func (*QueryEIPRequest) Reset

func (x *QueryEIPRequest) Reset()

func (*QueryEIPRequest) String

func (x *QueryEIPRequest) String() string

type STATUS

type STATUS int32
const (
	// 未知状态
	STATUS_UNKNOW STATUS = 0
	// 表示创建中
	STATUS_PENDING STATUS = 5
	// 绑定中
	STATUS_BINDING STATUS = 6
	// 解绑中
	STATUS_UNBINDING STATUS = 7
	// 已绑定
	STATUS_BIND STATUS = 11
	// 已解绑
	STATUS_UNBIND STATUS = 12
	// 状态异常
	STATUS_ERROR STATUS = 50
	// 释放中
	STATUS_OFFLINING STATUS = 80
	// 已销毁
	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 {
	SyncEIP(ctx context.Context, in *EIP, opts ...grpc.CallOption) (*EIP, error)
	QueryEIP(ctx context.Context, in *QueryEIPRequest, opts ...grpc.CallOption) (*EIPSet, 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 {
	SyncEIP(context.Context, *EIP) (*EIP, error)
	QueryEIP(context.Context, *QueryEIPRequest) (*EIPSet, 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) QueryEIP

func (UnimplementedServiceServer) SyncEIP

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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