named

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_modules_timer_named_named_proto protoreflect.FileDescriptor
View Source
var Named_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "timer.Named",
	HandlerType: (*NamedServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Observe",
			Handler:    _Named_Observe_Handler,
		},
		{
			MethodName: "Schedule",
			Handler:    _Named_Schedule_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "modules/timer/named/named.proto",
}

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

Functions

func RegisterNamedServer

func RegisterNamedServer(s grpc.ServiceRegistrar, srv NamedServer)

Types

type Config

type Config struct {
	TimeZone       string              `yaml:"timezone"`
	ReloadInterval int                 `yaml:"reload_interval"`
	FutureLimit    int                 `yaml:"future_limit"`
	RepeatEvents   []RepeatEventConfig `yaml:"repeat_events"`
	Events         []EventConfig       `yaml:"events"`
}

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type EventConfig

type EventConfig struct {
	// Produce is the name of the event to emit.
	Produce string   `yaml:"produce"`
	Time    string   `yaml:"time"`
	Days    []string `yaml:"days"`
}

type Named

type Named struct {
	UnimplementedNamedServer
	services.Service
	// contains filtered or unexported fields
}

func New

func New(cfg Config, logger log.Logger, conn *grpc.ClientConn) (*Named, error)

func (*Named) Connect

func (t *Named) Connect(ctx context.Context) error

Connect implements events.Producer

func (*Named) Observe

func (t *Named) Observe(ctx context.Context, req *NamedTimeStamp) (*Empty, error)

func (*Named) Schedule

func (t *Named) Schedule(ctx context.Context, req *NamedTimeStamp) (*Empty, error)

type NamedClient

type NamedClient interface {
	Observe(ctx context.Context, in *NamedTimeStamp, opts ...grpc.CallOption) (*Empty, error)
	Schedule(ctx context.Context, in *NamedTimeStamp, opts ...grpc.CallOption) (*Empty, error)
}

NamedClient is the client API for Named 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 NewNamedClient

func NewNamedClient(cc grpc.ClientConnInterface) NamedClient

type NamedServer

type NamedServer interface {
	Observe(context.Context, *NamedTimeStamp) (*Empty, error)
	Schedule(context.Context, *NamedTimeStamp) (*Empty, error)
	// contains filtered or unexported methods
}

NamedServer is the server API for Named service. All implementations must embed UnimplementedNamedServer for forward compatibility

type NamedTimeStamp

type NamedTimeStamp struct {
	Name string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*NamedTimeStamp) Descriptor deprecated

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

Deprecated: Use NamedTimeStamp.ProtoReflect.Descriptor instead.

func (*NamedTimeStamp) GetName

func (x *NamedTimeStamp) GetName() string

func (*NamedTimeStamp) GetTime

func (x *NamedTimeStamp) GetTime() *timestamppb.Timestamp

func (*NamedTimeStamp) ProtoMessage

func (*NamedTimeStamp) ProtoMessage()

func (*NamedTimeStamp) ProtoReflect

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

func (*NamedTimeStamp) Reset

func (x *NamedTimeStamp) Reset()

func (*NamedTimeStamp) String

func (x *NamedTimeStamp) String() string

type RepeatEventConfig

type RepeatEventConfig struct {
	// Produce is the name of the event to emit.
	Produce string `yaml:"produce"`
	Every   struct {
		Seconds int `yaml:"seconds"`
	} `yaml:"every"`
}

type UnimplementedNamedServer

type UnimplementedNamedServer struct {
}

UnimplementedNamedServer must be embedded to have forward compatible implementations.

func (UnimplementedNamedServer) Observe

func (UnimplementedNamedServer) Schedule

type UnsafeNamedServer

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

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

Jump to

Keyboard shortcuts

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