binoculars

package
v0.4.35 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package binoculars is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthBinoculars        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBinoculars          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBinoculars = fmt.Errorf("proto: unexpected end of group")
)

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)
	Cordon(ctx context.Context, in *CordonRequest, opts ...grpc.CallOption) (*types.Empty, 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)
	Cordon(context.Context, *CordonRequest) (*types.Empty, error)
}

BinocularsServer is the server API for Binoculars service.

type CordonRequest added in v0.3.69

type CordonRequest struct {
	NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"nodeName,omitempty"`
}

swagger:model

func (*CordonRequest) Descriptor added in v0.3.69

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

func (*CordonRequest) GetNodeName added in v0.3.69

func (m *CordonRequest) GetNodeName() string

func (*CordonRequest) Marshal added in v0.3.69

func (m *CordonRequest) Marshal() (dAtA []byte, err error)

func (*CordonRequest) MarshalTo added in v0.3.69

func (m *CordonRequest) MarshalTo(dAtA []byte) (int, error)

func (*CordonRequest) MarshalToSizedBuffer added in v0.3.69

func (m *CordonRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CordonRequest) ProtoMessage added in v0.3.69

func (*CordonRequest) ProtoMessage()

func (*CordonRequest) Reset added in v0.3.69

func (m *CordonRequest) Reset()

func (*CordonRequest) Size added in v0.3.69

func (m *CordonRequest) Size() (n int)

func (*CordonRequest) String added in v0.3.69

func (m *CordonRequest) String() string

func (*CordonRequest) Unmarshal added in v0.3.69

func (m *CordonRequest) Unmarshal(dAtA []byte) error

func (*CordonRequest) XXX_DiscardUnknown added in v0.3.69

func (m *CordonRequest) XXX_DiscardUnknown()

func (*CordonRequest) XXX_Marshal added in v0.3.69

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

func (*CordonRequest) XXX_Merge added in v0.3.69

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

func (*CordonRequest) XXX_Size added in v0.3.69

func (m *CordonRequest) XXX_Size() int

func (*CordonRequest) XXX_Unmarshal added in v0.3.69

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

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) Descriptor() ([]byte, []int)

func (*LogLine) GetLine

func (m *LogLine) GetLine() string

func (*LogLine) GetTimestamp

func (m *LogLine) GetTimestamp() string

func (*LogLine) Marshal

func (m *LogLine) Marshal() (dAtA []byte, err error)

func (*LogLine) MarshalTo

func (m *LogLine) MarshalTo(dAtA []byte) (int, error)

func (*LogLine) MarshalToSizedBuffer

func (m *LogLine) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogLine) ProtoMessage

func (*LogLine) ProtoMessage()

func (*LogLine) Reset

func (m *LogLine) Reset()

func (*LogLine) Size

func (m *LogLine) Size() (n int)

func (*LogLine) String

func (m *LogLine) String() string

func (*LogLine) Unmarshal

func (m *LogLine) Unmarshal(dAtA []byte) error

func (*LogLine) XXX_DiscardUnknown

func (m *LogLine) XXX_DiscardUnknown()

func (*LogLine) XXX_Marshal

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

func (*LogLine) XXX_Merge

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

func (*LogLine) XXX_Size

func (m *LogLine) XXX_Size() int

func (*LogLine) XXX_Unmarshal

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

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) MarshalTo

func (m *LogRequest) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *LogResponse) MarshalTo(dAtA []byte) (int, 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) Cordon added in v0.3.69

func (*UnimplementedBinocularsServer) Logs

Jump to

Keyboard shortcuts

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