pb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Example (Txtpb)
package main

import (
	"fmt"

	"github.com/skhal/lab/x/proto/pb"
	"google.golang.org/protobuf/encoding/prototext"
)

func main() {
	txtpb := `
message: "demo message"
`
	foo := new(pb.Foo)
	if err := prototext.Unmarshal([]byte(txtpb), foo); err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(foo.GetMessage())
	}
}
Output:
demo message

Index

Examples

Constants

View Source
const (
	Fooer_Foo_FullMethodName = "/x.proto.Fooer/Foo"
)

Variables

View Source
var File_fooer_proto protoreflect.FileDescriptor
View Source
var Fooer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "x.proto.Fooer",
	HandlerType: (*FooerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Foo",
			Handler:    _Fooer_Foo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "fooer.proto",
}

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

Functions

func RegisterFooerServer

func RegisterFooerServer(s grpc.ServiceRegistrar, srv FooerServer)

Types

type Foo

type Foo struct {
	XXX_raceDetectHookData protoimpl.RaceDetectHookData
	XXX_presence           [1]uint32
	// contains filtered or unexported fields
}

Next ID: 2

func (*Foo) ClearMessage

func (x *Foo) ClearMessage()

func (*Foo) GetMessage

func (x *Foo) GetMessage() string

func (*Foo) HasMessage

func (x *Foo) HasMessage() bool

func (*Foo) ProtoMessage

func (*Foo) ProtoMessage()

func (*Foo) ProtoReflect

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

func (*Foo) Reset

func (x *Foo) Reset()

func (*Foo) SetMessage

func (x *Foo) SetMessage(v string)

func (*Foo) String

func (x *Foo) String() string

type FooRequest

type FooRequest struct {
	XXX_raceDetectHookData protoimpl.RaceDetectHookData
	XXX_presence           [1]uint32
	// contains filtered or unexported fields
}

Next ID: 2

func (*FooRequest) ClearMessage

func (x *FooRequest) ClearMessage()

func (*FooRequest) GetMessage

func (x *FooRequest) GetMessage() string

func (*FooRequest) HasMessage

func (x *FooRequest) HasMessage() bool

func (*FooRequest) ProtoMessage

func (*FooRequest) ProtoMessage()

func (*FooRequest) ProtoReflect

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

func (*FooRequest) Reset

func (x *FooRequest) Reset()

func (*FooRequest) SetMessage

func (x *FooRequest) SetMessage(v string)

func (*FooRequest) String

func (x *FooRequest) String() string

type FooRequest_builder

type FooRequest_builder struct {
	Message *string
	// contains filtered or unexported fields
}

func (FooRequest_builder) Build

func (b0 FooRequest_builder) Build() *FooRequest

type FooResponse

type FooResponse struct {
	XXX_raceDetectHookData protoimpl.RaceDetectHookData
	XXX_presence           [1]uint32
	// contains filtered or unexported fields
}

Next ID: 2

func (*FooResponse) ClearMessage

func (x *FooResponse) ClearMessage()

func (*FooResponse) GetMessage

func (x *FooResponse) GetMessage() string

func (*FooResponse) HasMessage

func (x *FooResponse) HasMessage() bool

func (*FooResponse) ProtoMessage

func (*FooResponse) ProtoMessage()

func (*FooResponse) ProtoReflect

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

func (*FooResponse) Reset

func (x *FooResponse) Reset()

func (*FooResponse) SetMessage

func (x *FooResponse) SetMessage(v string)

func (*FooResponse) String

func (x *FooResponse) String() string

type FooResponse_builder

type FooResponse_builder struct {
	Message *string
	// contains filtered or unexported fields
}

func (FooResponse_builder) Build

func (b0 FooResponse_builder) Build() *FooResponse

type Foo_builder

type Foo_builder struct {
	Message *string
	// contains filtered or unexported fields
}

func (Foo_builder) Build

func (b0 Foo_builder) Build() *Foo

type FooerClient

type FooerClient interface {
	Foo(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooResponse, error)
}

FooerClient is the client API for Fooer 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 NewFooerClient

func NewFooerClient(cc grpc.ClientConnInterface) FooerClient

type FooerServer

type FooerServer interface {
	Foo(context.Context, *FooRequest) (*FooResponse, error)
	// contains filtered or unexported methods
}

FooerServer is the server API for Fooer service. All implementations must embed UnimplementedFooerServer for forward compatibility.

type UnimplementedFooerServer

type UnimplementedFooerServer struct{}

UnimplementedFooerServer 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 (UnimplementedFooerServer) Foo

type UnsafeFooerServer

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

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

Jump to

Keyboard shortcuts

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