protogen

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

package protogen contains protoc generated code for testable examples.

Index

Constants

This section is empty.

Variables

View Source
var (
	House_name = map[int32]string{
		0: "Gryffindor",
		1: "Hufflepuff",
		2: "Ravenclaw",
		3: "Slytherin",
	}
	House_value = map[string]int32{
		"Gryffindor": 0,
		"Hufflepuff": 1,
		"Ravenclaw":  2,
		"Slytherin":  3,
	}
)

Enum value maps for House.

View Source
var File_grpeakec_proto_docs_sorting_hat_proto protoreflect.FileDescriptor

Functions

func RegisterSortingHatServer

func RegisterSortingHatServer(s *grpc.Server, srv SortingHatServer)

Types

type House

type House int32

House is the house a Wizard is getting sorted into.

const (
	House_Gryffindor House = 0
	House_Hufflepuff House = 1
	House_Ravenclaw  House = 2
	House_Slytherin  House = 3
)

func (House) Descriptor

func (House) Descriptor() protoreflect.EnumDescriptor

func (House) Enum

func (x House) Enum() *House

func (House) EnumDescriptor deprecated

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

Deprecated: Use House.Descriptor instead.

func (House) Number

func (x House) Number() protoreflect.EnumNumber

func (House) String

func (x House) String() string

func (House) Type

func (House) Type() protoreflect.EnumType

type Pupil

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

Pupil is the wizard-to-be for sorting.

func (*Pupil) Descriptor deprecated

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

Deprecated: Use Pupil.ProtoReflect.Descriptor instead.

func (*Pupil) GetName

func (x *Pupil) GetName() string

func (*Pupil) ProtoMessage

func (*Pupil) ProtoMessage()

func (*Pupil) ProtoReflect

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

func (*Pupil) Reset

func (x *Pupil) Reset()

func (*Pupil) String

func (x *Pupil) String() string

type Sorted

type Sorted struct {
	House House `protobuf:"varint,1,opt,name=house,proto3,enum=sortinghat.House" json:"house,omitempty"`
	// contains filtered or unexported fields
}

Sorted returns the House the pupil has been placed into.

func (*Sorted) Descriptor deprecated

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

Deprecated: Use Sorted.ProtoReflect.Descriptor instead.

func (*Sorted) GetHouse

func (x *Sorted) GetHouse() House

func (*Sorted) ProtoMessage

func (*Sorted) ProtoMessage()

func (*Sorted) ProtoReflect

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

func (*Sorted) Reset

func (x *Sorted) Reset()

func (*Sorted) String

func (x *Sorted) String() string

type SortingHatClient

type SortingHatClient interface {
	// Sort sorts the pupil into a house.
	Sort(ctx context.Context, in *Pupil, opts ...grpc.CallOption) (*Sorted, error)
}

SortingHatClient is the client API for SortingHat service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSortingHatClient

func NewSortingHatClient(cc grpc.ClientConnInterface) SortingHatClient

type SortingHatServer

type SortingHatServer interface {
	// Sort sorts the pupil into a house.
	Sort(context.Context, *Pupil) (*Sorted, error)
}

SortingHatServer is the server API for SortingHat service.

type UnimplementedSortingHatServer

type UnimplementedSortingHatServer struct {
}

UnimplementedSortingHatServer can be embedded to have forward compatible implementations.

func (*UnimplementedSortingHatServer) Sort

Jump to

Keyboard shortcuts

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