Documentation ¶
Overview ¶
Package publisher is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func NewPublisherEndpoints() []*api.Endpoint
- func RegisterPublisherGw(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPublisherGwClient(ctx context.Context, mux *runtime.ServeMux, client PublisherClient) error
- func RegisterPublisherGwFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPublisherGwServer(ctx context.Context, mux *runtime.ServeMux, server PublisherServer) error
- func RegisterPublisherHandler(s server.Server, hdlr PublisherHandler, opts ...server.HandlerOption) error
- func RegisterPublisherServer(s grpc.ServiceRegistrar, srv PublisherServer)
- type PublisherClient
- type PublisherHandler
- type PublisherServer
- type PublisherService
- type TaskSpec
- func (*TaskSpec) Descriptor() ([]byte, []int)deprecated
- func (x *TaskSpec) GetAssignedNode() string
- func (x *TaskSpec) GetCreationTime() int64
- func (x *TaskSpec) GetId() string
- func (x *TaskSpec) GetLoc() string
- func (x *TaskSpec) GetName() string
- func (x *TaskSpec) GetSumname() string
- func (x *TaskSpec) GetType() string
- func (*TaskSpec) ProtoMessage()
- func (x *TaskSpec) ProtoReflect() protoreflect.Message
- func (x *TaskSpec) Reset()
- func (x *TaskSpec) String() string
- type UnimplementedPublisherServer
- type UnsafePublisherServer
Constants ¶
const (
Publisher_PushTask_FullMethodName = "/Publisher/PushTask"
)
Variables ¶
var File_publisher_proto protoreflect.FileDescriptor
var Publisher_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Publisher", HandlerType: (*PublisherServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PushTask", Handler: _Publisher_PushTask_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "publisher.proto", }
Publisher_ServiceDesc is the grpc.ServiceDesc for Publisher service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func NewPublisherEndpoints ¶
func RegisterPublisherGw ¶
RegisterPublisherGw registers the http handlers for service Publisher to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPublisherGwClient ¶
func RegisterPublisherGwClient(ctx context.Context, mux *runtime.ServeMux, client PublisherClient) error
RegisterPublisherGwClient registers the http handlers for service Publisher to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PublisherClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PublisherClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PublisherClient" to call the correct interceptors.
func RegisterPublisherGwFromEndpoint ¶
func RegisterPublisherGwFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPublisherGwFromEndpoint is same as RegisterPublisherGw but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPublisherGwServer ¶
func RegisterPublisherGwServer(ctx context.Context, mux *runtime.ServeMux, server PublisherServer) error
RegisterPublisherGwServer registers the http handlers for service Publisher to "mux". UnaryRPC :call PublisherServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPublisherGwFromEndpoint instead.
func RegisterPublisherHandler ¶
func RegisterPublisherHandler(s server.Server, hdlr PublisherHandler, opts ...server.HandlerOption) error
func RegisterPublisherServer ¶
func RegisterPublisherServer(s grpc.ServiceRegistrar, srv PublisherServer)
Types ¶
type PublisherClient ¶
type PublisherClient interface {
PushTask(ctx context.Context, in *TaskSpec, opts ...grpc.CallOption) (*empty.Empty, error)
}
PublisherClient is the client API for Publisher 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 NewPublisherClient ¶
func NewPublisherClient(cc grpc.ClientConnInterface) PublisherClient
type PublisherHandler ¶
type PublisherServer ¶
type PublisherServer interface { PushTask(context.Context, *TaskSpec) (*empty.Empty, error) // contains filtered or unexported methods }
PublisherServer is the server API for Publisher service. All implementations must embed UnimplementedPublisherServer for forward compatibility
type PublisherService ¶
type PublisherService interface {
PushTask(ctx context.Context, in *TaskSpec, opts ...client.CallOption) (*empty.Empty, error)
}
func NewPublisherService ¶
func NewPublisherService(name string, c client.Client) PublisherService
type TaskSpec ¶
type TaskSpec struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Loc string `protobuf:"bytes,3,opt,name=loc,proto3" json:"loc,omitempty"` AssignedNode string `protobuf:"bytes,4,opt,name=assigned_node,json=assignedNode,proto3" json:"assigned_node,omitempty"` CreationTime int64 `protobuf:"varint,5,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` Sumname string `protobuf:"bytes,6,opt,name=sumname,proto3" json:"sumname,omitempty"` Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*TaskSpec) Descriptor
deprecated
func (*TaskSpec) GetAssignedNode ¶
func (*TaskSpec) GetCreationTime ¶
func (*TaskSpec) GetSumname ¶
func (*TaskSpec) ProtoMessage ¶
func (*TaskSpec) ProtoMessage()
func (*TaskSpec) ProtoReflect ¶
func (x *TaskSpec) ProtoReflect() protoreflect.Message
type UnimplementedPublisherServer ¶
type UnimplementedPublisherServer struct { }
UnimplementedPublisherServer must be embedded to have forward compatible implementations.
type UnsafePublisherServer ¶
type UnsafePublisherServer interface {
// contains filtered or unexported methods
}
UnsafePublisherServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PublisherServer will result in compilation errors.