proto

package
v0.0.14-r11 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_settings_proto_settings_proto protoreflect.FileDescriptor
View Source
var SettingsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "nocloud.settings.SettingsService",
	HandlerType: (*SettingsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _SettingsService_Get_Handler,
		},
		{
			MethodName: "Put",
			Handler:    _SettingsService_Put_Handler,
		},
		{
			MethodName: "Keys",
			Handler:    _SettingsService_Keys_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/settings/proto/settings.proto",
}

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

Functions

func RegisterSettingsServiceHandler

func RegisterSettingsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error

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

func RegisterSettingsServiceHandlerClient

func RegisterSettingsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SettingsServiceClient) error

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

func RegisterSettingsServiceHandlerFromEndpoint

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

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

func RegisterSettingsServiceHandlerServer

func RegisterSettingsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SettingsServiceServer) error

RegisterSettingsServiceHandlerServer registers the http handlers for service SettingsService to "mux". UnaryRPC :call SettingsServiceServer 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 RegisterSettingsServiceHandlerFromEndpoint instead.

func RegisterSettingsServiceServer

func RegisterSettingsServiceServer(s grpc.ServiceRegistrar, srv SettingsServiceServer)

Types

type GetRequest

type GetRequest struct {
	Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKeys

func (x *GetRequest) GetKeys() []string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type KeysRequest

type KeysRequest struct {
	// contains filtered or unexported fields
}

func (*KeysRequest) Descriptor deprecated

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

Deprecated: Use KeysRequest.ProtoReflect.Descriptor instead.

func (*KeysRequest) ProtoMessage

func (*KeysRequest) ProtoMessage()

func (*KeysRequest) ProtoReflect

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

func (*KeysRequest) Reset

func (x *KeysRequest) Reset()

func (*KeysRequest) String

func (x *KeysRequest) String() string

type KeysResponse

type KeysResponse struct {
	Pool []*KeysResponse_Key `protobuf:"bytes,1,rep,name=pool,proto3" json:"pool,omitempty"`
	// contains filtered or unexported fields
}

func (*KeysResponse) Descriptor deprecated

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

Deprecated: Use KeysResponse.ProtoReflect.Descriptor instead.

func (*KeysResponse) GetPool

func (x *KeysResponse) GetPool() []*KeysResponse_Key

func (*KeysResponse) ProtoMessage

func (*KeysResponse) ProtoMessage()

func (*KeysResponse) ProtoReflect

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

func (*KeysResponse) Reset

func (x *KeysResponse) Reset()

func (*KeysResponse) String

func (x *KeysResponse) String() string

type KeysResponse_Key

type KeysResponse_Key struct {
	Key         string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Public      bool   `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"`
	// contains filtered or unexported fields
}

func (*KeysResponse_Key) Descriptor deprecated

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

Deprecated: Use KeysResponse_Key.ProtoReflect.Descriptor instead.

func (*KeysResponse_Key) GetDescription

func (x *KeysResponse_Key) GetDescription() string

func (*KeysResponse_Key) GetKey

func (x *KeysResponse_Key) GetKey() string

func (*KeysResponse_Key) GetPublic

func (x *KeysResponse_Key) GetPublic() bool

func (*KeysResponse_Key) ProtoMessage

func (*KeysResponse_Key) ProtoMessage()

func (*KeysResponse_Key) ProtoReflect

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

func (*KeysResponse_Key) Reset

func (x *KeysResponse_Key) Reset()

func (*KeysResponse_Key) String

func (x *KeysResponse_Key) String() string

type PutRequest

type PutRequest struct {
	Key         string  `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value       string  `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Description *string `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"`
	Public      *bool   `protobuf:"varint,4,opt,name=public,proto3,oneof" json:"public,omitempty"`
	// contains filtered or unexported fields
}

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetDescription

func (x *PutRequest) GetDescription() string

func (*PutRequest) GetKey

func (x *PutRequest) GetKey() string

func (*PutRequest) GetPublic

func (x *PutRequest) GetPublic() bool

func (*PutRequest) GetValue

func (x *PutRequest) GetValue() string

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type PutResponse

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

func (*PutResponse) Descriptor deprecated

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

Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.

func (*PutResponse) GetKey

func (x *PutResponse) GetKey() string

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) ProtoReflect

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

func (*PutResponse) Reset

func (x *PutResponse) Reset()

func (*PutResponse) String

func (x *PutResponse) String() string

type SettingsServiceClient

type SettingsServiceClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*structpb.Struct, error)
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	// rpc Sub(nocloud.settings.SubRequest) returns (stream nocloud.settings.SubRequest);
	Keys(ctx context.Context, in *KeysRequest, opts ...grpc.CallOption) (*KeysResponse, error)
}

SettingsServiceClient is the client API for SettingsService 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.

type SettingsServiceServer

type SettingsServiceServer interface {
	Get(context.Context, *GetRequest) (*structpb.Struct, error)
	Put(context.Context, *PutRequest) (*PutResponse, error)
	// rpc Sub(nocloud.settings.SubRequest) returns (stream nocloud.settings.SubRequest);
	Keys(context.Context, *KeysRequest) (*KeysResponse, error)
	// contains filtered or unexported methods
}

SettingsServiceServer is the server API for SettingsService service. All implementations must embed UnimplementedSettingsServiceServer for forward compatibility

type UnimplementedSettingsServiceServer

type UnimplementedSettingsServiceServer struct {
}

UnimplementedSettingsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSettingsServiceServer) Get

func (UnimplementedSettingsServiceServer) Keys

func (UnimplementedSettingsServiceServer) Put

type UnsafeSettingsServiceServer

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

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

Jump to

Keyboard shortcuts

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