proto

package
v0.0.0-...-8e53d61 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const StatusCode_OK = enums.StatusCode_OK
View Source
const StatusCode_STATUS_CHECK_SUCCESS = enums.StatusCode_STATUS_CHECK_SUCCESS
View Source
const SuggestionCode_NIL = enums.SuggestionCode_NIL

Variables

View Source
var File_v1_hubble_proto protoreflect.FileDescriptor
View Source
var Hubble_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Hubble",
	HandlerType: (*HubbleServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Hubble_SayHello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/hubble.proto",
}

Hubble_ServiceDesc is the grpc.ServiceDesc for Hubble service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var StatusCode_name = enums.StatusCode_name
View Source
var StatusCode_value = enums.StatusCode_value
View Source
var SuggestionCode_name = enums.SuggestionCode_name
View Source
var SuggestionCode_value = enums.SuggestionCode_value

Functions

func RegisterHubbleHandler

func RegisterHubbleHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterHubbleHandler registers the http handlers for service Hubble to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterHubbleHandlerClient

func RegisterHubbleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HubbleClient) error

RegisterHubbleHandlerClient registers the http handlers for service Hubble to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HubbleClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HubbleClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HubbleClient" to call the correct interceptors.

func RegisterHubbleHandlerFromEndpoint

func RegisterHubbleHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterHubbleHandlerFromEndpoint is same as RegisterHubbleHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterHubbleHandlerServer

func RegisterHubbleHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HubbleServer) error

RegisterHubbleHandlerServer registers the http handlers for service Hubble to "mux". UnaryRPC :call HubbleServer 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 RegisterHubbleHandlerFromEndpoint instead.

func RegisterHubbleServer

func RegisterHubbleServer(s grpc.ServiceRegistrar, srv HubbleServer)

Types

type ActionableErr

type ActionableErr struct {
	ErrCode     enums.StatusCode `protobuf:"varint,1,opt,name=errCode,proto3,enum=proto.enums.StatusCode" json:"errCode,omitempty"` // error code representing the error
	Message     string           `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`                              // message describing the error.
	Suggestions []*Suggestion    `protobuf:"bytes,3,rep,name=suggestions,proto3" json:"suggestions,omitempty"`                      // list of suggestions
	// contains filtered or unexported fields
}

`ActionableErr` defines an error that occurred along with an optional list of suggestions

func (*ActionableErr) Descriptor deprecated

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

Deprecated: Use ActionableErr.ProtoReflect.Descriptor instead.

func (*ActionableErr) GetErrCode

func (x *ActionableErr) GetErrCode() enums.StatusCode

func (*ActionableErr) GetMessage

func (x *ActionableErr) GetMessage() string

func (*ActionableErr) GetSuggestions

func (x *ActionableErr) GetSuggestions() []*Suggestion

func (*ActionableErr) ProtoMessage

func (*ActionableErr) ProtoMessage()

func (*ActionableErr) ProtoReflect

func (x *ActionableErr) ProtoReflect() protoreflect.Message

func (*ActionableErr) Reset

func (x *ActionableErr) Reset()

func (*ActionableErr) String

func (x *ActionableErr) String() string

type HelloReply

type HelloReply struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloReply) Descriptor deprecated

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

func (x *HelloReply) ProtoReflect() protoreflect.Message

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

func (x *HelloRequest) ProtoReflect() protoreflect.Message

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type HubbleClient

type HubbleClient interface {
	// 打招呼方法
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}

HubbleClient is the client API for Hubble 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 NewHubbleClient

func NewHubbleClient(cc grpc.ClientConnInterface) HubbleClient

type HubbleServer

type HubbleServer interface {
	// 打招呼方法
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	// contains filtered or unexported methods
}

HubbleServer is the server API for Hubble service. All implementations must embed UnimplementedHubbleServer for forward compatibility

type StatusCheckState

type StatusCheckState struct {
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// A map of `resource name -> status-check-state`. Where `resource-name` is the kubernetes resource name.
	// The `status-check-state` can be <br>
	// - `"Not started"`: indicates that `status-check` has just started. <br>
	// - `"In progress"`: InProgress is sent after every resource check is complete. <br>
	// - `"Succeeded"`:
	// - `"Failed"`:
	Resources map[string]string `` /* 159-byte string literal not displayed */
	// StatusCheck statusCode
	StatusCode enums.StatusCode `protobuf:"varint,3,opt,name=statusCode,proto3,enum=proto.enums.StatusCode" json:"statusCode,omitempty"`
	// contains filtered or unexported fields
}

`StatusCheckState` describes the state of status check of current deployed resources.

func (*StatusCheckState) Descriptor deprecated

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

Deprecated: Use StatusCheckState.ProtoReflect.Descriptor instead.

func (*StatusCheckState) GetResources

func (x *StatusCheckState) GetResources() map[string]string

func (*StatusCheckState) GetStatus

func (x *StatusCheckState) GetStatus() string

func (*StatusCheckState) GetStatusCode

func (x *StatusCheckState) GetStatusCode() enums.StatusCode

func (*StatusCheckState) ProtoMessage

func (*StatusCheckState) ProtoMessage()

func (*StatusCheckState) ProtoReflect

func (x *StatusCheckState) ProtoReflect() protoreflect.Message

func (*StatusCheckState) Reset

func (x *StatusCheckState) Reset()

func (*StatusCheckState) String

func (x *StatusCheckState) String() string

type StatusCode

type StatusCode = enums.StatusCode

type Suggestion

type Suggestion struct {
	SuggestionCode enums.SuggestionCode `protobuf:"varint,1,opt,name=suggestionCode,proto3,enum=proto.enums.SuggestionCode" json:"suggestionCode,omitempty"` // code representing a suggestion
	Action         string               `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`                                                  // action represents the suggestion action
	// contains filtered or unexported fields
}

Suggestion defines the action a user needs to recover from an error.

func (*Suggestion) Descriptor deprecated

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

Deprecated: Use Suggestion.ProtoReflect.Descriptor instead.

func (*Suggestion) GetAction

func (x *Suggestion) GetAction() string

func (*Suggestion) GetSuggestionCode

func (x *Suggestion) GetSuggestionCode() enums.SuggestionCode

func (*Suggestion) ProtoMessage

func (*Suggestion) ProtoMessage()

func (*Suggestion) ProtoReflect

func (x *Suggestion) ProtoReflect() protoreflect.Message

func (*Suggestion) Reset

func (x *Suggestion) Reset()

func (*Suggestion) String

func (x *Suggestion) String() string

type SuggestionCode

type SuggestionCode = enums.SuggestionCode

type UnimplementedHubbleServer

type UnimplementedHubbleServer struct {
}

UnimplementedHubbleServer must be embedded to have forward compatible implementations.

func (UnimplementedHubbleServer) SayHello

type UnsafeHubbleServer

type UnsafeHubbleServer interface {
	// contains filtered or unexported methods
}

UnsafeHubbleServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HubbleServer will result in compilation errors.

Jump to

Keyboard shortcuts

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