watchpb

package
v0.0.0-...-b0b32c5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventType_name = map[int32]string{
	0: "CREATE",
	1: "UPDATE",
	2: "DELETE",
}
View Source
var EventType_value = map[string]int32{
	"CREATE": 0,
	"UPDATE": 1,
	"DELETE": 2,
}

Functions

func RegisterWatchRPCServer

func RegisterWatchRPCServer(s *grpc.Server, srv WatchRPCServer)

Types

type App

type App struct {
	// 应用名称
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// 环境
	Env                  string   `protobuf:"bytes,2,opt,name=env,proto3" json:"env,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*App) Descriptor

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

func (*App) GetEnv

func (m *App) GetEnv() string

func (*App) GetName

func (m *App) GetName() string

func (*App) ProtoMessage

func (*App) ProtoMessage()

func (*App) Reset

func (m *App) Reset()

func (*App) String

func (m *App) String() string

func (*App) XXX_DiscardUnknown

func (m *App) XXX_DiscardUnknown()

func (*App) XXX_Marshal

func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*App) XXX_Merge

func (m *App) XXX_Merge(src proto.Message)

func (*App) XXX_Size

func (m *App) XXX_Size() int

func (*App) XXX_Unmarshal

func (m *App) XXX_Unmarshal(b []byte) error

type AppServer

type AppServer struct {
	// IP
	Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	// PORT
	Port                 string   `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AppServer) Descriptor

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

func (*AppServer) GetIp

func (m *AppServer) GetIp() string

func (*AppServer) GetPort

func (m *AppServer) GetPort() string

func (*AppServer) ProtoMessage

func (*AppServer) ProtoMessage()

func (*AppServer) Reset

func (m *AppServer) Reset()

func (*AppServer) String

func (m *AppServer) String() string

func (*AppServer) XXX_DiscardUnknown

func (m *AppServer) XXX_DiscardUnknown()

func (*AppServer) XXX_Marshal

func (m *AppServer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppServer) XXX_Merge

func (m *AppServer) XXX_Merge(src proto.Message)

func (*AppServer) XXX_Size

func (m *AppServer) XXX_Size() int

func (*AppServer) XXX_Unmarshal

func (m *AppServer) XXX_Unmarshal(b []byte) error

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type EventType

type EventType int32
const (
	// 新增APP
	EventType_CREATE EventType = 0
	// APP的服务器地址有更新
	EventType_UPDATE EventType = 1
	// 删除APP
	EventType_DELETE EventType = 2
)

func (EventType) EnumDescriptor

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

func (EventType) String

func (x EventType) String() string

type GetAppResponse

type GetAppResponse struct {
	App                  *App         `protobuf:"bytes,1,opt,name=app,proto3" json:"app,omitempty"`
	Servers              []*AppServer `protobuf:"bytes,2,rep,name=servers,proto3" json:"servers,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*GetAppResponse) Descriptor

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

func (*GetAppResponse) GetApp

func (m *GetAppResponse) GetApp() *App

func (*GetAppResponse) GetServers

func (m *GetAppResponse) GetServers() []*AppServer

func (*GetAppResponse) ProtoMessage

func (*GetAppResponse) ProtoMessage()

func (*GetAppResponse) Reset

func (m *GetAppResponse) Reset()

func (*GetAppResponse) String

func (m *GetAppResponse) String() string

func (*GetAppResponse) XXX_DiscardUnknown

func (m *GetAppResponse) XXX_DiscardUnknown()

func (*GetAppResponse) XXX_Marshal

func (m *GetAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetAppResponse) XXX_Merge

func (m *GetAppResponse) XXX_Merge(src proto.Message)

func (*GetAppResponse) XXX_Size

func (m *GetAppResponse) XXX_Size() int

func (*GetAppResponse) XXX_Unmarshal

func (m *GetAppResponse) XXX_Unmarshal(b []byte) error

type UnimplementedWatchRPCServer

type UnimplementedWatchRPCServer struct {
}

UnimplementedWatchRPCServer can be embedded to have forward compatible implementations.

func (*UnimplementedWatchRPCServer) GetAppServers

func (*UnimplementedWatchRPCServer) GetAppServers(ctx context.Context, req *App) (*GetAppResponse, error)

func (*UnimplementedWatchRPCServer) Watch

type WatchCancelRequest

type WatchCancelRequest struct {
	WatchId              string   `protobuf:"bytes,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WatchCancelRequest) Descriptor

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

func (*WatchCancelRequest) GetWatchId

func (m *WatchCancelRequest) GetWatchId() string

func (*WatchCancelRequest) ProtoMessage

func (*WatchCancelRequest) ProtoMessage()

func (*WatchCancelRequest) Reset

func (m *WatchCancelRequest) Reset()

func (*WatchCancelRequest) String

func (m *WatchCancelRequest) String() string

func (*WatchCancelRequest) XXX_DiscardUnknown

func (m *WatchCancelRequest) XXX_DiscardUnknown()

func (*WatchCancelRequest) XXX_Marshal

func (m *WatchCancelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WatchCancelRequest) XXX_Merge

func (m *WatchCancelRequest) XXX_Merge(src proto.Message)

func (*WatchCancelRequest) XXX_Size

func (m *WatchCancelRequest) XXX_Size() int

func (*WatchCancelRequest) XXX_Unmarshal

func (m *WatchCancelRequest) XXX_Unmarshal(b []byte) error

type WatchCreateRequest

type WatchCreateRequest struct {
	WatchId              string   `protobuf:"bytes,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"`
	App                  *App     `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WatchCreateRequest) Descriptor

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

func (*WatchCreateRequest) GetApp

func (m *WatchCreateRequest) GetApp() *App

func (*WatchCreateRequest) GetWatchId

func (m *WatchCreateRequest) GetWatchId() string

func (*WatchCreateRequest) ProtoMessage

func (*WatchCreateRequest) ProtoMessage()

func (*WatchCreateRequest) Reset

func (m *WatchCreateRequest) Reset()

func (*WatchCreateRequest) String

func (m *WatchCreateRequest) String() string

func (*WatchCreateRequest) XXX_DiscardUnknown

func (m *WatchCreateRequest) XXX_DiscardUnknown()

func (*WatchCreateRequest) XXX_Marshal

func (m *WatchCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WatchCreateRequest) XXX_Merge

func (m *WatchCreateRequest) XXX_Merge(src proto.Message)

func (*WatchCreateRequest) XXX_Size

func (m *WatchCreateRequest) XXX_Size() int

func (*WatchCreateRequest) XXX_Unmarshal

func (m *WatchCreateRequest) XXX_Unmarshal(b []byte) error

type WatchRPCClient

type WatchRPCClient interface {
	// 获取app的服务器地址
	GetAppServers(ctx context.Context, in *App, opts ...grpc.CallOption) (*GetAppResponse, error)
	// 推送app服务器地址的变化情况
	Watch(ctx context.Context, opts ...grpc.CallOption) (WatchRPC_WatchClient, error)
}

WatchRPCClient is the client API for WatchRPC service.

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

func NewWatchRPCClient

func NewWatchRPCClient(cc *grpc.ClientConn) WatchRPCClient

type WatchRPCServer

type WatchRPCServer interface {
	// 获取app的服务器地址
	GetAppServers(context.Context, *App) (*GetAppResponse, error)
	// 推送app服务器地址的变化情况
	Watch(WatchRPC_WatchServer) error
}

WatchRPCServer is the server API for WatchRPC service.

type WatchRPC_WatchClient

type WatchRPC_WatchClient interface {
	Send(*WatchRequest) error
	Recv() (*WatchResponse, error)
	grpc.ClientStream
}

type WatchRPC_WatchServer

type WatchRPC_WatchServer interface {
	Send(*WatchResponse) error
	Recv() (*WatchRequest, error)
	grpc.ServerStream
}

type WatchRequest

type WatchRequest struct {
	// Types that are valid to be assigned to RequestUnion:
	//	*WatchRequest_CreateRequest
	//	*WatchRequest_CancelRequest
	RequestUnion         isWatchRequest_RequestUnion `protobuf_oneof:"request_union"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (*WatchRequest) Descriptor

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

func (*WatchRequest) GetCancelRequest

func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest

func (*WatchRequest) GetCreateRequest

func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest

func (*WatchRequest) GetRequestUnion

func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) Reset

func (m *WatchRequest) Reset()

func (*WatchRequest) String

func (m *WatchRequest) String() string

func (*WatchRequest) XXX_DiscardUnknown

func (m *WatchRequest) XXX_DiscardUnknown()

func (*WatchRequest) XXX_Marshal

func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WatchRequest) XXX_Merge

func (m *WatchRequest) XXX_Merge(src proto.Message)

func (*WatchRequest) XXX_OneofWrappers

func (*WatchRequest) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*WatchRequest) XXX_Size

func (m *WatchRequest) XXX_Size() int

func (*WatchRequest) XXX_Unmarshal

func (m *WatchRequest) XXX_Unmarshal(b []byte) error

type WatchRequest_CancelRequest

type WatchRequest_CancelRequest struct {
	CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,proto3,oneof"`
}

type WatchRequest_CreateRequest

type WatchRequest_CreateRequest struct {
	CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,proto3,oneof"`
}

type WatchResponse

type WatchResponse struct {
	Event EventType `protobuf:"varint,1,opt,name=event,proto3,enum=watchpb.EventType" json:"event,omitempty"`
	App   *App      `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"`
	// 用于服务端标记连接的创建成功
	Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"`
	// 用于服务端收到客户端取消连接的信号,并处理成功后的返回
	Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"`
	// cancel_reason indicates the reason for canceling the watcher.
	CancelReason         string       `protobuf:"bytes,5,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"`
	Servers              []*AppServer `protobuf:"bytes,6,rep,name=servers,proto3" json:"servers,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*WatchResponse) Descriptor

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

func (*WatchResponse) GetApp

func (m *WatchResponse) GetApp() *App

func (*WatchResponse) GetCancelReason

func (m *WatchResponse) GetCancelReason() string

func (*WatchResponse) GetCanceled

func (m *WatchResponse) GetCanceled() bool

func (*WatchResponse) GetCreated

func (m *WatchResponse) GetCreated() bool

func (*WatchResponse) GetEvent

func (m *WatchResponse) GetEvent() EventType

func (*WatchResponse) GetServers

func (m *WatchResponse) GetServers() []*AppServer

func (*WatchResponse) ProtoMessage

func (*WatchResponse) ProtoMessage()

func (*WatchResponse) Reset

func (m *WatchResponse) Reset()

func (*WatchResponse) String

func (m *WatchResponse) String() string

func (*WatchResponse) XXX_DiscardUnknown

func (m *WatchResponse) XXX_DiscardUnknown()

func (*WatchResponse) XXX_Marshal

func (m *WatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WatchResponse) XXX_Merge

func (m *WatchResponse) XXX_Merge(src proto.Message)

func (*WatchResponse) XXX_Size

func (m *WatchResponse) XXX_Size() int

func (*WatchResponse) XXX_Unmarshal

func (m *WatchResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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