protox

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnimplemented = errors.New("method not implemented")

ErrUnimplemented is returned when a method is not implemented.

Functions

This section is empty.

Types

type FromProto

type FromProto[P any] interface {
	FromProto(ptr *P) error
}

FromProto is an interface for types that can be populated from protobuf messages.

type ProtoX

type ProtoX[P any] interface {
	FromProto(*P) error
	ToProto() (*P, error)
}

ProtoX is an interface that combines ToProto and FromProto.

type ToProto

type ToProto[M any] interface {
	ToProto() (*M, error)
}

ToProto is an interface for types that can be converted to protobuf messages.

type UnimplementedFromProto

type UnimplementedFromProto struct{}

UnimplementedFromProto is a struct that implements the FromProto interface with a default method.

func (UnimplementedFromProto) FromProto

func (u UnimplementedFromProto) FromProto(ptr any) error

FromProto returns ErrUnimplemented, indicating that the method is unimplemented.

type UnimplementedProto

type UnimplementedProto struct {
	UnimplementedToProto
	UnimplementedFromProto
}

UnimplementedProto is a struct that implements the Proto interface with default methods.

type UnimplementedToProto

type UnimplementedToProto struct{}

UnimplementedToProto is a struct that implements the ToProto interface with a default method.

func (UnimplementedToProto) ToProto

func (u UnimplementedToProto) ToProto() (proto.Message, error)

ToProto returns nil, indicating that the method is unimplemented.

Jump to

Keyboard shortcuts

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