proto

package
v0.0.0-...-3736fb9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PetType_name = map[int32]string{
		0: "PTUnknown",
		1: "PTCanine",
		2: "PTFeline",
		3: "PTBird",
		4: "PTReptile",
	}
	PetType_value = map[string]int32{
		"PTUnknown": 0,
		"PTCanine":  1,
		"PTFeline":  2,
		"PTBird":    3,
		"PTReptile": 4,
	}
)

Enum value maps for PetType.

View Source
var (
	SamplerType_name = map[int32]string{
		0: "STUnknown",
		1: "STNever",
		2: "STAlways",
		3: "STFloat",
	}
	SamplerType_value = map[string]int32{
		"STUnknown": 0,
		"STNever":   1,
		"STAlways":  2,
		"STFloat":   3,
	}
)

Enum value maps for SamplerType.

View Source
var File_petstore_proto protoreflect.FileDescriptor
View Source
var PetStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "petstore.PetStore",
	HandlerType: (*PetStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddPets",
			Handler:    _PetStore_AddPets_Handler,
		},
		{
			MethodName: "UpdatePets",
			Handler:    _PetStore_UpdatePets_Handler,
		},
		{
			MethodName: "DeletePets",
			Handler:    _PetStore_DeletePets_Handler,
		},
		{
			MethodName: "ChangeSampler",
			Handler:    _PetStore_ChangeSampler_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SearchPets",
			Handler:       _PetStore_SearchPets_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "petstore.proto",
}

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

Functions

func RegisterPetStoreServer

func RegisterPetStoreServer(s grpc.ServiceRegistrar, srv PetStoreServer)

Types

type AddPetsReq

type AddPetsReq struct {

	// The pet information to add. Pet.id must not be set.
	Pets []*Pet `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	// contains filtered or unexported fields
}

The request used to add a pets to the system.

func (*AddPetsReq) Descriptor deprecated

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

Deprecated: Use AddPetsReq.ProtoReflect.Descriptor instead.

func (*AddPetsReq) GetPets

func (x *AddPetsReq) GetPets() []*Pet

func (*AddPetsReq) ProtoMessage

func (*AddPetsReq) ProtoMessage()

func (*AddPetsReq) ProtoReflect

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

func (*AddPetsReq) Reset

func (x *AddPetsReq) Reset()

func (*AddPetsReq) String

func (x *AddPetsReq) String() string

type AddPetsResp

type AddPetsResp struct {

	// The IDs of the pets that were added.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

The response do AddPets().

func (*AddPetsResp) Descriptor deprecated

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

Deprecated: Use AddPetsResp.ProtoReflect.Descriptor instead.

func (*AddPetsResp) GetIds

func (x *AddPetsResp) GetIds() []string

func (*AddPetsResp) ProtoMessage

func (*AddPetsResp) ProtoMessage()

func (*AddPetsResp) ProtoReflect

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

func (*AddPetsResp) Reset

func (x *AddPetsResp) Reset()

func (*AddPetsResp) String

func (x *AddPetsResp) String() string

type ChangeSamplerReq

type ChangeSamplerReq struct {
	Sampler *Sampler `protobuf:"bytes,1,opt,name=sampler,proto3" json:"sampler,omitempty"`
	// contains filtered or unexported fields
}

Used to request we change the OTEL sampling.

func (*ChangeSamplerReq) Descriptor deprecated

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

Deprecated: Use ChangeSamplerReq.ProtoReflect.Descriptor instead.

func (*ChangeSamplerReq) GetSampler

func (x *ChangeSamplerReq) GetSampler() *Sampler

func (*ChangeSamplerReq) ProtoMessage

func (*ChangeSamplerReq) ProtoMessage()

func (*ChangeSamplerReq) ProtoReflect

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

func (*ChangeSamplerReq) Reset

func (x *ChangeSamplerReq) Reset()

func (*ChangeSamplerReq) String

func (x *ChangeSamplerReq) String() string

type ChangeSamplerResp

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

The response to a sampling change.

func (*ChangeSamplerResp) Descriptor deprecated

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

Deprecated: Use ChangeSamplerResp.ProtoReflect.Descriptor instead.

func (*ChangeSamplerResp) ProtoMessage

func (*ChangeSamplerResp) ProtoMessage()

func (*ChangeSamplerResp) ProtoReflect

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

func (*ChangeSamplerResp) Reset

func (x *ChangeSamplerResp) Reset()

func (*ChangeSamplerResp) String

func (x *ChangeSamplerResp) String() string

type DateRange

type DateRange struct {

	// When to start the range, this is inclusive.
	Start *date.Date `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"`
	// When to end the range, this is exclusive.
	End *date.Date `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

Represents a range of dates.

func (*DateRange) Descriptor deprecated

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

Deprecated: Use DateRange.ProtoReflect.Descriptor instead.

func (*DateRange) GetEnd

func (x *DateRange) GetEnd() *date.Date

func (*DateRange) GetStart

func (x *DateRange) GetStart() *date.Date

func (*DateRange) ProtoMessage

func (*DateRange) ProtoMessage()

func (*DateRange) ProtoReflect

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

func (*DateRange) Reset

func (x *DateRange) Reset()

func (*DateRange) String

func (x *DateRange) String() string

type DeletePetsReq

type DeletePetsReq struct {

	// The IDs of the pets to delete.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

Used to indicate which pets to delete. This is an all or nothing request.

func (*DeletePetsReq) Descriptor deprecated

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

Deprecated: Use DeletePetsReq.ProtoReflect.Descriptor instead.

func (*DeletePetsReq) GetIds

func (x *DeletePetsReq) GetIds() []string

func (*DeletePetsReq) ProtoMessage

func (*DeletePetsReq) ProtoMessage()

func (*DeletePetsReq) ProtoReflect

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

func (*DeletePetsReq) Reset

func (x *DeletePetsReq) Reset()

func (*DeletePetsReq) String

func (x *DeletePetsReq) String() string

type DeletePetsResp

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

The response to a DeletePet().

func (*DeletePetsResp) Descriptor deprecated

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

Deprecated: Use DeletePetsResp.ProtoReflect.Descriptor instead.

func (*DeletePetsResp) ProtoMessage

func (*DeletePetsResp) ProtoMessage()

func (*DeletePetsResp) ProtoReflect

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

func (*DeletePetsResp) Reset

func (x *DeletePetsResp) Reset()

func (*DeletePetsResp) String

func (x *DeletePetsResp) String() string

type Pet

type Pet struct {

	// A UUIDv4 for this pet. This can never be set on an AddPet().
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The name of the pet.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The type of pet.
	Type PetType `protobuf:"varint,3,opt,name=type,proto3,enum=petstore.PetType" json:"type,omitempty"`
	// The pet's birthday.
	Birthday *date.Date `protobuf:"bytes,4,opt,name=birthday,proto3" json:"birthday,omitempty"`
	// contains filtered or unexported fields
}

Represents a unique pet.

func (*Pet) Descriptor deprecated

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

Deprecated: Use Pet.ProtoReflect.Descriptor instead.

func (*Pet) GetBirthday

func (x *Pet) GetBirthday() *date.Date

func (*Pet) GetId

func (x *Pet) GetId() string

func (*Pet) GetName

func (x *Pet) GetName() string

func (*Pet) GetType

func (x *Pet) GetType() PetType

func (*Pet) ProtoMessage

func (*Pet) ProtoMessage()

func (*Pet) ProtoReflect

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

func (*Pet) Reset

func (x *Pet) Reset()

func (*Pet) String

func (x *Pet) String() string

type PetStoreClient

type PetStoreClient interface {
	// Adds pets to the pet store.
	AddPets(ctx context.Context, in *AddPetsReq, opts ...grpc.CallOption) (*AddPetsResp, error)
	// Updates pets entries in the store.
	UpdatePets(ctx context.Context, in *UpdatePetsReq, opts ...grpc.CallOption) (*UpdatePetsResp, error)
	// Deletes pets from the pet store.
	DeletePets(ctx context.Context, in *DeletePetsReq, opts ...grpc.CallOption) (*DeletePetsResp, error)
	// Finds pets in the pet store.
	SearchPets(ctx context.Context, in *SearchPetsReq, opts ...grpc.CallOption) (PetStore_SearchPetsClient, error)
	// Changes the OTEL sampling type.
	ChangeSampler(ctx context.Context, in *ChangeSamplerReq, opts ...grpc.CallOption) (*ChangeSamplerResp, error)
}

PetStoreClient is the client API for PetStore 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 NewPetStoreClient

func NewPetStoreClient(cc grpc.ClientConnInterface) PetStoreClient

type PetStoreServer

type PetStoreServer interface {
	// Adds pets to the pet store.
	AddPets(context.Context, *AddPetsReq) (*AddPetsResp, error)
	// Updates pets entries in the store.
	UpdatePets(context.Context, *UpdatePetsReq) (*UpdatePetsResp, error)
	// Deletes pets from the pet store.
	DeletePets(context.Context, *DeletePetsReq) (*DeletePetsResp, error)
	// Finds pets in the pet store.
	SearchPets(*SearchPetsReq, PetStore_SearchPetsServer) error
	// Changes the OTEL sampling type.
	ChangeSampler(context.Context, *ChangeSamplerReq) (*ChangeSamplerResp, error)
	// contains filtered or unexported methods
}

PetStoreServer is the server API for PetStore service. All implementations must embed UnimplementedPetStoreServer for forward compatibility

type PetStore_SearchPetsClient

type PetStore_SearchPetsClient interface {
	Recv() (*Pet, error)
	grpc.ClientStream
}

type PetStore_SearchPetsServer

type PetStore_SearchPetsServer interface {
	Send(*Pet) error
	grpc.ServerStream
}

type PetType

type PetType int32

Desribes the type of pets.

const (
	// The type was not set.
	PetType_PTUnknown PetType = 0
	// The pet is a canine.
	PetType_PTCanine PetType = 1
	// The pet is a feline.
	PetType_PTFeline PetType = 2
	// The pet is a bird.
	PetType_PTBird PetType = 3
	// The pet is a reptile.
	PetType_PTReptile PetType = 4
)

func (PetType) Descriptor

func (PetType) Descriptor() protoreflect.EnumDescriptor

func (PetType) Enum

func (x PetType) Enum() *PetType

func (PetType) EnumDescriptor deprecated

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

Deprecated: Use PetType.Descriptor instead.

func (PetType) Number

func (x PetType) Number() protoreflect.EnumNumber

func (PetType) String

func (x PetType) String() string

func (PetType) Type

func (PetType) Type() protoreflect.EnumType

type Sampler

type Sampler struct {

	// The type of sampling to change to.
	Type SamplerType `protobuf:"varint,1,opt,name=type,proto3,enum=petstore.SamplerType" json:"type,omitempty"`
	// This is the sampling rate if type == STFloat. Values must be
	// > 0 and <= 1.0 .
	FloatValue float64 `protobuf:"fixed64,2,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"`
	// contains filtered or unexported fields
}

func (*Sampler) Descriptor deprecated

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

Deprecated: Use Sampler.ProtoReflect.Descriptor instead.

func (*Sampler) GetFloatValue

func (x *Sampler) GetFloatValue() float64

func (*Sampler) GetType

func (x *Sampler) GetType() SamplerType

func (*Sampler) ProtoMessage

func (*Sampler) ProtoMessage()

func (*Sampler) ProtoReflect

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

func (*Sampler) Reset

func (x *Sampler) Reset()

func (*Sampler) String

func (x *Sampler) String() string

type SamplerType

type SamplerType int32

Types of OTEL sampling we support.

const (
	SamplerType_STUnknown SamplerType = 0
	SamplerType_STNever   SamplerType = 1
	SamplerType_STAlways  SamplerType = 2
	SamplerType_STFloat   SamplerType = 3
)

func (SamplerType) Descriptor

func (SamplerType) Enum

func (x SamplerType) Enum() *SamplerType

func (SamplerType) EnumDescriptor deprecated

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

Deprecated: Use SamplerType.Descriptor instead.

func (SamplerType) Number

func (x SamplerType) Number() protoreflect.EnumNumber

func (SamplerType) String

func (x SamplerType) String() string

func (SamplerType) Type

type SearchPetsReq

type SearchPetsReq struct {

	// Pet names to filter by.
	Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	// Pet types to filter by.
	Types []PetType `protobuf:"varint,2,rep,packed,name=types,proto3,enum=petstore.PetType" json:"types,omitempty"`
	// Birthdays to filter by.
	BirthdateRange *DateRange `protobuf:"bytes,3,opt,name=birthdate_range,json=birthdateRange,proto3" json:"birthdate_range,omitempty"`
	// contains filtered or unexported fields
}

The request to search for pets.

func (*SearchPetsReq) Descriptor deprecated

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

Deprecated: Use SearchPetsReq.ProtoReflect.Descriptor instead.

func (*SearchPetsReq) GetBirthdateRange

func (x *SearchPetsReq) GetBirthdateRange() *DateRange

func (*SearchPetsReq) GetNames

func (x *SearchPetsReq) GetNames() []string

func (*SearchPetsReq) GetTypes

func (x *SearchPetsReq) GetTypes() []PetType

func (*SearchPetsReq) ProtoMessage

func (*SearchPetsReq) ProtoMessage()

func (*SearchPetsReq) ProtoReflect

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

func (*SearchPetsReq) Reset

func (x *SearchPetsReq) Reset()

func (*SearchPetsReq) String

func (x *SearchPetsReq) String() string

type UnimplementedPetStoreServer

type UnimplementedPetStoreServer struct {
}

UnimplementedPetStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedPetStoreServer) AddPets

func (UnimplementedPetStoreServer) ChangeSampler

func (UnimplementedPetStoreServer) DeletePets

func (UnimplementedPetStoreServer) SearchPets

func (UnimplementedPetStoreServer) UpdatePets

type UnsafePetStoreServer

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

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

type UpdatePetsReq

type UpdatePetsReq struct {

	// The pet information to update. Pet.id must be set.
	Pets []*Pet `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	// contains filtered or unexported fields
}

The request used to update pets in the system.

func (*UpdatePetsReq) Descriptor deprecated

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

Deprecated: Use UpdatePetsReq.ProtoReflect.Descriptor instead.

func (*UpdatePetsReq) GetPets

func (x *UpdatePetsReq) GetPets() []*Pet

func (*UpdatePetsReq) ProtoMessage

func (*UpdatePetsReq) ProtoMessage()

func (*UpdatePetsReq) ProtoReflect

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

func (*UpdatePetsReq) Reset

func (x *UpdatePetsReq) Reset()

func (*UpdatePetsReq) String

func (x *UpdatePetsReq) String() string

type UpdatePetsResp

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

The response do UpdatePets().

func (*UpdatePetsResp) Descriptor deprecated

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

Deprecated: Use UpdatePetsResp.ProtoReflect.Descriptor instead.

func (*UpdatePetsResp) ProtoMessage

func (*UpdatePetsResp) ProtoMessage()

func (*UpdatePetsResp) ProtoReflect

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

func (*UpdatePetsResp) Reset

func (x *UpdatePetsResp) Reset()

func (*UpdatePetsResp) String

func (x *UpdatePetsResp) String() string

Jump to

Keyboard shortcuts

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