giorpc

package module
v0.0.0-...-f440cac Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 11 Imported by: 0

README

giorpc

Example grpc client based around gio (gioui.org)

Documentation

Index

Constants

View Source
const (
	Giorpc_Encode_FullMethodName = "/giorpc.Giorpc/Encode"
	Giorpc_Decode_FullMethodName = "/giorpc.Giorpc/Decode"
)

Variables

View Source
var (
	Encoding_name = map[int32]string{
		0: "ENCODING_UNSPECIFIED",
		1: "ENCODING_BASE32_STANDARD",
		2: "ENCODING_BASE32_HEXIDECIMAL",
		3: "ENCODING_BASE64_STANDARD",
		4: "ENCODING_BASE64_URL_SAFE",
	}
	Encoding_value = map[string]int32{
		"ENCODING_UNSPECIFIED":        0,
		"ENCODING_BASE32_STANDARD":    1,
		"ENCODING_BASE32_HEXIDECIMAL": 2,
		"ENCODING_BASE64_STANDARD":    3,
		"ENCODING_BASE64_URL_SAFE":    4,
	}
)

Enum value maps for Encoding.

View Source
var File_example_proto protoreflect.FileDescriptor
View Source
var Giorpc_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "giorpc.Giorpc",
	HandlerType: (*GiorpcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Encode",
			Handler:    _Giorpc_Encode_Handler,
		},
		{
			MethodName: "Decode",
			Handler:    _Giorpc_Decode_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example.proto",
}

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

Functions

func RegisterGiorpcServer

func RegisterGiorpcServer(s grpc.ServiceRegistrar, srv GiorpcServer)

Types

type DecodeRequest

type DecodeRequest struct {
	Encoding Encoding `protobuf:"varint,1,opt,name=encoding,proto3,enum=giorpc.Encoding" json:"encoding,omitempty"`
	Encoded  string   `protobuf:"bytes,2,opt,name=encoded,proto3" json:"encoded,omitempty"`
	// contains filtered or unexported fields
}

func (*DecodeRequest) Descriptor deprecated

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

Deprecated: Use DecodeRequest.ProtoReflect.Descriptor instead.

func (*DecodeRequest) GetEncoded

func (x *DecodeRequest) GetEncoded() string

func (*DecodeRequest) GetEncoding

func (x *DecodeRequest) GetEncoding() Encoding

func (*DecodeRequest) ProtoMessage

func (*DecodeRequest) ProtoMessage()

func (*DecodeRequest) ProtoReflect

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

func (*DecodeRequest) Reset

func (x *DecodeRequest) Reset()

func (*DecodeRequest) String

func (x *DecodeRequest) String() string

type DecodeResponse

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

func (*DecodeResponse) Descriptor deprecated

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

Deprecated: Use DecodeResponse.ProtoReflect.Descriptor instead.

func (*DecodeResponse) GetDecoded

func (x *DecodeResponse) GetDecoded() string

func (*DecodeResponse) ProtoMessage

func (*DecodeResponse) ProtoMessage()

func (*DecodeResponse) ProtoReflect

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

func (*DecodeResponse) Reset

func (x *DecodeResponse) Reset()

func (*DecodeResponse) String

func (x *DecodeResponse) String() string

type EncodeRequest

type EncodeRequest struct {
	Encoding Encoding `protobuf:"varint,1,opt,name=encoding,proto3,enum=giorpc.Encoding" json:"encoding,omitempty"`
	Decoded  string   `protobuf:"bytes,2,opt,name=decoded,proto3" json:"decoded,omitempty"`
	// contains filtered or unexported fields
}

func (*EncodeRequest) Descriptor deprecated

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

Deprecated: Use EncodeRequest.ProtoReflect.Descriptor instead.

func (*EncodeRequest) GetDecoded

func (x *EncodeRequest) GetDecoded() string

func (*EncodeRequest) GetEncoding

func (x *EncodeRequest) GetEncoding() Encoding

func (*EncodeRequest) ProtoMessage

func (*EncodeRequest) ProtoMessage()

func (*EncodeRequest) ProtoReflect

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

func (*EncodeRequest) Reset

func (x *EncodeRequest) Reset()

func (*EncodeRequest) String

func (x *EncodeRequest) String() string

type EncodeResponse

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

func (*EncodeResponse) Descriptor deprecated

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

Deprecated: Use EncodeResponse.ProtoReflect.Descriptor instead.

func (*EncodeResponse) GetEncoded

func (x *EncodeResponse) GetEncoded() string

func (*EncodeResponse) ProtoMessage

func (*EncodeResponse) ProtoMessage()

func (*EncodeResponse) ProtoReflect

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

func (*EncodeResponse) Reset

func (x *EncodeResponse) Reset()

func (*EncodeResponse) String

func (x *EncodeResponse) String() string

type Encoding

type Encoding int32
const (
	Encoding_ENCODING_UNSPECIFIED        Encoding = 0
	Encoding_ENCODING_BASE32_STANDARD    Encoding = 1
	Encoding_ENCODING_BASE32_HEXIDECIMAL Encoding = 2
	Encoding_ENCODING_BASE64_STANDARD    Encoding = 3
	Encoding_ENCODING_BASE64_URL_SAFE    Encoding = 4
)

func (Encoding) Descriptor

func (Encoding) Descriptor() protoreflect.EnumDescriptor

func (Encoding) Enum

func (x Encoding) Enum() *Encoding

func (Encoding) EnumDescriptor deprecated

func (Encoding) EnumDescriptor() ([]byte, []int)

Deprecated: Use Encoding.Descriptor instead.

func (Encoding) Number

func (x Encoding) Number() protoreflect.EnumNumber

func (Encoding) String

func (x Encoding) String() string

func (Encoding) Type

type GiorpcClient

type GiorpcClient interface {
	Encode(ctx context.Context, in *EncodeRequest, opts ...grpc.CallOption) (*EncodeResponse, error)
	Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeResponse, error)
}

GiorpcClient is the client API for Giorpc 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 NewGiorpcClient

func NewGiorpcClient(cc grpc.ClientConnInterface) GiorpcClient

type GiorpcServer

type GiorpcServer interface {
	Encode(context.Context, *EncodeRequest) (*EncodeResponse, error)
	Decode(context.Context, *DecodeRequest) (*DecodeResponse, error)
	// contains filtered or unexported methods
}

GiorpcServer is the server API for Giorpc service. All implementations must embed UnimplementedGiorpcServer for forward compatibility.

type Service

type Service struct {
	UnimplementedGiorpcServer
}

func (*Service) Decode

func (s *Service) Decode(ctx context.Context, request *DecodeRequest) (*DecodeResponse, error)

func (*Service) Encode

func (s *Service) Encode(ctx context.Context, request *EncodeRequest) (*EncodeResponse, error)

type UnimplementedGiorpcServer

type UnimplementedGiorpcServer struct{}

UnimplementedGiorpcServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedGiorpcServer) Decode

func (UnimplementedGiorpcServer) Encode

type UnsafeGiorpcServer

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

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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