Documentation ¶
Index ¶
- Variables
- func RegisterWatchRPCServer(s *grpc.Server, srv WatchRPCServer)
- type App
- func (*App) Descriptor() ([]byte, []int)
- func (m *App) GetEnv() string
- func (m *App) GetName() string
- func (*App) ProtoMessage()
- func (m *App) Reset()
- func (m *App) String() string
- func (m *App) XXX_DiscardUnknown()
- func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *App) XXX_Merge(src proto.Message)
- func (m *App) XXX_Size() int
- func (m *App) XXX_Unmarshal(b []byte) error
- type AppServer
- func (*AppServer) Descriptor() ([]byte, []int)
- func (m *AppServer) GetIp() string
- func (m *AppServer) GetPort() string
- func (*AppServer) ProtoMessage()
- func (m *AppServer) Reset()
- func (m *AppServer) String() string
- func (m *AppServer) XXX_DiscardUnknown()
- func (m *AppServer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AppServer) XXX_Merge(src proto.Message)
- func (m *AppServer) XXX_Size() int
- func (m *AppServer) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type EventType
- type GetAppResponse
- func (*GetAppResponse) Descriptor() ([]byte, []int)
- func (m *GetAppResponse) GetApp() *App
- func (m *GetAppResponse) GetServers() []*AppServer
- func (*GetAppResponse) ProtoMessage()
- func (m *GetAppResponse) Reset()
- func (m *GetAppResponse) String() string
- func (m *GetAppResponse) XXX_DiscardUnknown()
- func (m *GetAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetAppResponse) XXX_Merge(src proto.Message)
- func (m *GetAppResponse) XXX_Size() int
- func (m *GetAppResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedWatchRPCServer
- type WatchCancelRequest
- func (*WatchCancelRequest) Descriptor() ([]byte, []int)
- func (m *WatchCancelRequest) GetWatchId() string
- func (*WatchCancelRequest) ProtoMessage()
- func (m *WatchCancelRequest) Reset()
- func (m *WatchCancelRequest) String() string
- func (m *WatchCancelRequest) XXX_DiscardUnknown()
- func (m *WatchCancelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WatchCancelRequest) XXX_Merge(src proto.Message)
- func (m *WatchCancelRequest) XXX_Size() int
- func (m *WatchCancelRequest) XXX_Unmarshal(b []byte) error
- type WatchCreateRequest
- func (*WatchCreateRequest) Descriptor() ([]byte, []int)
- func (m *WatchCreateRequest) GetApp() *App
- func (m *WatchCreateRequest) GetWatchId() string
- func (*WatchCreateRequest) ProtoMessage()
- func (m *WatchCreateRequest) Reset()
- func (m *WatchCreateRequest) String() string
- func (m *WatchCreateRequest) XXX_DiscardUnknown()
- func (m *WatchCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WatchCreateRequest) XXX_Merge(src proto.Message)
- func (m *WatchCreateRequest) XXX_Size() int
- func (m *WatchCreateRequest) XXX_Unmarshal(b []byte) error
- type WatchRPCClient
- type WatchRPCServer
- type WatchRPC_WatchClient
- type WatchRPC_WatchServer
- type WatchRequest
- func (*WatchRequest) Descriptor() ([]byte, []int)
- func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest
- func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest
- func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion
- func (*WatchRequest) ProtoMessage()
- func (m *WatchRequest) Reset()
- func (m *WatchRequest) String() string
- func (m *WatchRequest) XXX_DiscardUnknown()
- func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WatchRequest) XXX_Merge(src proto.Message)
- func (*WatchRequest) XXX_OneofWrappers() []interface{}
- func (m *WatchRequest) XXX_Size() int
- func (m *WatchRequest) XXX_Unmarshal(b []byte) error
- type WatchRequest_CancelRequest
- type WatchRequest_CreateRequest
- type WatchResponse
- func (*WatchResponse) Descriptor() ([]byte, []int)
- func (m *WatchResponse) GetApp() *App
- func (m *WatchResponse) GetCancelReason() string
- func (m *WatchResponse) GetCanceled() bool
- func (m *WatchResponse) GetCreated() bool
- func (m *WatchResponse) GetEvent() EventType
- func (m *WatchResponse) GetServers() []*AppServer
- func (*WatchResponse) ProtoMessage()
- func (m *WatchResponse) Reset()
- func (m *WatchResponse) String() string
- func (m *WatchResponse) XXX_DiscardUnknown()
- func (m *WatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WatchResponse) XXX_Merge(src proto.Message)
- func (m *WatchResponse) XXX_Size() int
- func (m *WatchResponse) XXX_Unmarshal(b []byte) error
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) ProtoMessage ¶
func (*App) ProtoMessage()
func (*App) XXX_DiscardUnknown ¶
func (m *App) XXX_DiscardUnknown()
func (*App) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*AppServer) ProtoMessage()
func (*AppServer) XXX_DiscardUnknown ¶
func (m *AppServer) XXX_DiscardUnknown()
func (*AppServer) XXX_Marshal ¶
func (*AppServer) XXX_Unmarshal ¶
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
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 ¶
func (*UnimplementedWatchRPCServer) Watch(srv WatchRPC_WatchServer) error
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
Click to show internal directories.
Click to hide internal directories.