Documentation ¶
Overview ¶
Package binoculars is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterBinocularsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBinocularsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BinocularsClient) error
- func RegisterBinocularsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBinocularsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BinocularsServer) error
- func RegisterBinocularsServer(s *grpc.Server, srv BinocularsServer)
- func SwaggerJsonTemplate() string
- type BinocularsClient
- type BinocularsServer
- type LogLine
- func (*LogLine) Descriptor() ([]byte, []int)
- func (m *LogLine) GetLine() string
- func (m *LogLine) GetTimestamp() string
- func (m *LogLine) Marshal() (dAtA []byte, err error)
- func (m *LogLine) MarshalTo(dAtA []byte) (int, error)
- func (m *LogLine) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogLine) ProtoMessage()
- func (m *LogLine) Reset()
- func (m *LogLine) Size() (n int)
- func (m *LogLine) String() string
- func (m *LogLine) Unmarshal(dAtA []byte) error
- func (m *LogLine) XXX_DiscardUnknown()
- func (m *LogLine) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogLine) XXX_Merge(src proto.Message)
- func (m *LogLine) XXX_Size() int
- func (m *LogLine) XXX_Unmarshal(b []byte) error
- type LogRequest
- func (*LogRequest) Descriptor() ([]byte, []int)
- func (m *LogRequest) GetJobId() string
- func (m *LogRequest) GetLogOptions() *v1.PodLogOptions
- func (m *LogRequest) GetPodNamespace() string
- func (m *LogRequest) GetPodNumber() int32
- func (m *LogRequest) GetSinceTime() string
- func (m *LogRequest) Marshal() (dAtA []byte, err error)
- func (m *LogRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *LogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogRequest) ProtoMessage()
- func (m *LogRequest) Reset()
- func (m *LogRequest) Size() (n int)
- func (m *LogRequest) String() string
- func (m *LogRequest) Unmarshal(dAtA []byte) error
- func (m *LogRequest) XXX_DiscardUnknown()
- func (m *LogRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogRequest) XXX_Merge(src proto.Message)
- func (m *LogRequest) XXX_Size() int
- func (m *LogRequest) XXX_Unmarshal(b []byte) error
- type LogResponse
- func (*LogResponse) Descriptor() ([]byte, []int)
- func (m *LogResponse) GetLog() []*LogLine
- func (m *LogResponse) Marshal() (dAtA []byte, err error)
- func (m *LogResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *LogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogResponse) ProtoMessage()
- func (m *LogResponse) Reset()
- func (m *LogResponse) Size() (n int)
- func (m *LogResponse) String() string
- func (m *LogResponse) Unmarshal(dAtA []byte) error
- func (m *LogResponse) XXX_DiscardUnknown()
- func (m *LogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogResponse) XXX_Merge(src proto.Message)
- func (m *LogResponse) XXX_Size() int
- func (m *LogResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedBinocularsServer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterBinocularsHandler ¶
func RegisterBinocularsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBinocularsHandler registers the http handlers for service Binoculars to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBinocularsHandlerClient ¶
func RegisterBinocularsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BinocularsClient) error
RegisterBinocularsHandlerClient registers the http handlers for service Binoculars to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BinocularsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BinocularsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BinocularsClient" to call the correct interceptors.
func RegisterBinocularsHandlerFromEndpoint ¶
func RegisterBinocularsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBinocularsHandlerFromEndpoint is same as RegisterBinocularsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBinocularsHandlerServer ¶
func RegisterBinocularsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BinocularsServer) error
RegisterBinocularsHandlerServer registers the http handlers for service Binoculars to "mux". UnaryRPC :call BinocularsServer 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 RegisterBinocularsHandlerFromEndpoint instead.
func RegisterBinocularsServer ¶
func RegisterBinocularsServer(s *grpc.Server, srv BinocularsServer)
func SwaggerJsonTemplate ¶
func SwaggerJsonTemplate() string
SwaggerJsonTemplate is a generated function returning the template as a string. That string should be parsed by the functions of the golang's template package.
Types ¶
type BinocularsClient ¶
type BinocularsClient interface {
Logs(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error)
}
BinocularsClient is the client API for Binoculars service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBinocularsClient ¶
func NewBinocularsClient(cc *grpc.ClientConn) BinocularsClient
type BinocularsServer ¶
type BinocularsServer interface {
Logs(context.Context, *LogRequest) (*LogResponse, error)
}
BinocularsServer is the server API for Binoculars service.
type LogLine ¶
type LogLine struct { Timestamp string `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Line string `protobuf:"bytes,2,opt,name=line,proto3" json:"line,omitempty"` }
swagger:model
func (*LogLine) Descriptor ¶
func (*LogLine) GetTimestamp ¶
func (*LogLine) MarshalToSizedBuffer ¶
func (*LogLine) ProtoMessage ¶
func (*LogLine) ProtoMessage()
func (*LogLine) XXX_DiscardUnknown ¶
func (m *LogLine) XXX_DiscardUnknown()
func (*LogLine) XXX_Marshal ¶
func (*LogLine) XXX_Unmarshal ¶
type LogRequest ¶
type LogRequest struct { JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"jobId,omitempty"` PodNumber int32 `protobuf:"varint,2,opt,name=pod_number,json=podNumber,proto3" json:"podNumber,omitempty"` PodNamespace string `protobuf:"bytes,3,opt,name=pod_namespace,json=podNamespace,proto3" json:"podNamespace,omitempty"` SinceTime string `protobuf:"bytes,4,opt,name=since_time,json=sinceTime,proto3" json:"sinceTime,omitempty"` LogOptions *v1.PodLogOptions `protobuf:"bytes,5,opt,name=log_options,json=logOptions,proto3" json:"logOptions,omitempty"` }
swagger:model
func (*LogRequest) Descriptor ¶
func (*LogRequest) Descriptor() ([]byte, []int)
func (*LogRequest) GetJobId ¶
func (m *LogRequest) GetJobId() string
func (*LogRequest) GetLogOptions ¶
func (m *LogRequest) GetLogOptions() *v1.PodLogOptions
func (*LogRequest) GetPodNamespace ¶
func (m *LogRequest) GetPodNamespace() string
func (*LogRequest) GetPodNumber ¶
func (m *LogRequest) GetPodNumber() int32
func (*LogRequest) GetSinceTime ¶
func (m *LogRequest) GetSinceTime() string
func (*LogRequest) Marshal ¶
func (m *LogRequest) Marshal() (dAtA []byte, err error)
func (*LogRequest) MarshalToSizedBuffer ¶
func (m *LogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LogRequest) ProtoMessage ¶
func (*LogRequest) ProtoMessage()
func (*LogRequest) Reset ¶
func (m *LogRequest) Reset()
func (*LogRequest) Size ¶
func (m *LogRequest) Size() (n int)
func (*LogRequest) String ¶
func (m *LogRequest) String() string
func (*LogRequest) Unmarshal ¶
func (m *LogRequest) Unmarshal(dAtA []byte) error
func (*LogRequest) XXX_DiscardUnknown ¶
func (m *LogRequest) XXX_DiscardUnknown()
func (*LogRequest) XXX_Marshal ¶
func (m *LogRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LogRequest) XXX_Merge ¶
func (m *LogRequest) XXX_Merge(src proto.Message)
func (*LogRequest) XXX_Size ¶
func (m *LogRequest) XXX_Size() int
func (*LogRequest) XXX_Unmarshal ¶
func (m *LogRequest) XXX_Unmarshal(b []byte) error
type LogResponse ¶
type LogResponse struct {
Log []*LogLine `protobuf:"bytes,1,rep,name=log,proto3" json:"log,omitempty"`
}
swagger:model
func (*LogResponse) Descriptor ¶
func (*LogResponse) Descriptor() ([]byte, []int)
func (*LogResponse) GetLog ¶
func (m *LogResponse) GetLog() []*LogLine
func (*LogResponse) Marshal ¶
func (m *LogResponse) Marshal() (dAtA []byte, err error)
func (*LogResponse) MarshalToSizedBuffer ¶
func (m *LogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LogResponse) ProtoMessage ¶
func (*LogResponse) ProtoMessage()
func (*LogResponse) Reset ¶
func (m *LogResponse) Reset()
func (*LogResponse) Size ¶
func (m *LogResponse) Size() (n int)
func (*LogResponse) String ¶
func (m *LogResponse) String() string
func (*LogResponse) Unmarshal ¶
func (m *LogResponse) Unmarshal(dAtA []byte) error
func (*LogResponse) XXX_DiscardUnknown ¶
func (m *LogResponse) XXX_DiscardUnknown()
func (*LogResponse) XXX_Marshal ¶
func (m *LogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LogResponse) XXX_Merge ¶
func (m *LogResponse) XXX_Merge(src proto.Message)
func (*LogResponse) XXX_Size ¶
func (m *LogResponse) XXX_Size() int
func (*LogResponse) XXX_Unmarshal ¶
func (m *LogResponse) XXX_Unmarshal(b []byte) error
type UnimplementedBinocularsServer ¶
type UnimplementedBinocularsServer struct { }
UnimplementedBinocularsServer can be embedded to have forward compatible implementations.
func (*UnimplementedBinocularsServer) Logs ¶
func (*UnimplementedBinocularsServer) Logs(ctx context.Context, req *LogRequest) (*LogResponse, error)