protos

package
v0.0.0-...-0f1adcb Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MoodState_name = map[int32]string{
		0: "Happy",
		1: "Sad",
	}
	MoodState_value = map[string]int32{
		"Happy": 0,
		"Sad":   1,
	}
)

Enum value maps for MoodState.

View Source
var File_cmd_api_protos_tracker_api_proto protoreflect.FileDescriptor
View Source
var TrackerAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tracker.TrackerAPI",
	HandlerType: (*TrackerAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLog",
			Handler:    _TrackerAPI_CreateLog_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cmd/api/protos/tracker-api.proto",
}

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

Functions

func RegisterTrackerAPIServer

func RegisterTrackerAPIServer(s grpc.ServiceRegistrar, srv TrackerAPIServer)

Types

type DailyLog

type DailyLog struct {
	Date int64 `protobuf:"varint,1,opt,name=Date,proto3" json:"Date,omitempty"` // Date following the epoch format.
	Mood *Mood `protobuf:"bytes,2,opt,name=Mood,proto3" json:"Mood,omitempty"`  // Mood log of the day.
	// contains filtered or unexported fields
}

func (*DailyLog) Descriptor deprecated

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

Deprecated: Use DailyLog.ProtoReflect.Descriptor instead.

func (*DailyLog) GetDate

func (x *DailyLog) GetDate() int64

func (*DailyLog) GetMood

func (x *DailyLog) GetMood() *Mood

func (*DailyLog) ProtoMessage

func (*DailyLog) ProtoMessage()

func (*DailyLog) ProtoReflect

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

func (*DailyLog) Reset

func (x *DailyLog) Reset()

func (*DailyLog) String

func (x *DailyLog) String() string

type Mood

type Mood struct {
	State MoodState `protobuf:"varint,1,opt,name=State,proto3,enum=tracker.MoodState" json:"State,omitempty"` // MoodState defines the mood state among defined values.
	// contains filtered or unexported fields
}

Mood definition.

func (*Mood) Descriptor deprecated

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

Deprecated: Use Mood.ProtoReflect.Descriptor instead.

func (*Mood) GetState

func (x *Mood) GetState() MoodState

func (*Mood) ProtoMessage

func (*Mood) ProtoMessage()

func (*Mood) ProtoReflect

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

func (*Mood) Reset

func (x *Mood) Reset()

func (*Mood) String

func (x *Mood) String() string

type MoodState

type MoodState int32

MoodType, the possible values for a mood.

const (
	MoodState_Happy MoodState = 0 // Happy feeling
	MoodState_Sad   MoodState = 1 // Sad feeling
)

func (MoodState) Descriptor

func (MoodState) Descriptor() protoreflect.EnumDescriptor

func (MoodState) Enum

func (x MoodState) Enum() *MoodState

func (MoodState) EnumDescriptor deprecated

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

Deprecated: Use MoodState.Descriptor instead.

func (MoodState) Number

func (x MoodState) Number() protoreflect.EnumNumber

func (MoodState) String

func (x MoodState) String() string

func (MoodState) Type

type Server

type Server struct{}

Server is the gRPC server holding endpoints implementation

func (*Server) CreateLog

func (s *Server) CreateLog(ctx context.Context, dl *DailyLog) (*emptypb.Empty, error)

CreateLog adds a new mood.

type TrackerAPIClient

type TrackerAPIClient interface {
	// CreateLog adds the given mood.
	CreateLog(ctx context.Context, in *DailyLog, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

TrackerAPIClient is the client API for TrackerAPI 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 NewTrackerAPIClient

func NewTrackerAPIClient(cc grpc.ClientConnInterface) TrackerAPIClient

type TrackerAPIServer

type TrackerAPIServer interface {
	// CreateLog adds the given mood.
	CreateLog(context.Context, *DailyLog) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

TrackerAPIServer is the server API for TrackerAPI service. All implementations must embed UnimplementedTrackerAPIServer for forward compatibility

type UnimplementedTrackerAPIServer

type UnimplementedTrackerAPIServer struct {
}

UnimplementedTrackerAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedTrackerAPIServer) CreateLog

type UnsafeTrackerAPIServer

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

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

Jump to

Keyboard shortcuts

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