ticker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTicker        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTicker          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTicker = fmt.Errorf("proto: unexpected end of group")
)

Functions

func Run

func Run(ctx context.Context, log *zap.Logger, nc *nats.Conn, subject string) error

Run publishes time ticks to NATS channel with given subject

Types

type Service

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

func New

func New(log *zap.Logger, mq *nats.Conn, subject string) *Service

func (Service) TimeService

func (p Service) TimeService(in *TimeRequest, stream TimeServiceServer) error

TimeService is a gRPC service for ticker

type TimeRequest

type TimeRequest struct {
	// интервал обновления (сек)
	Every int32 `protobuf:"varint,1,opt,name=every,proto3" json:"every,omitempty"`
	// количество ответов
	Max                  int32    `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TimeRequest) Descriptor

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

func (*TimeRequest) GetEvery

func (m *TimeRequest) GetEvery() int32

func (*TimeRequest) GetMax

func (m *TimeRequest) GetMax() int32

func (*TimeRequest) Marshal

func (m *TimeRequest) Marshal() (dAtA []byte, err error)

func (*TimeRequest) MarshalTo

func (m *TimeRequest) MarshalTo(dAtA []byte) (int, error)

func (*TimeRequest) MarshalToSizedBuffer

func (m *TimeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimeRequest) ProtoMessage

func (*TimeRequest) ProtoMessage()

func (*TimeRequest) Reset

func (m *TimeRequest) Reset()

func (*TimeRequest) Size

func (m *TimeRequest) Size() (n int)

func (*TimeRequest) String

func (m *TimeRequest) String() string

func (*TimeRequest) Unmarshal

func (m *TimeRequest) Unmarshal(dAtA []byte) error

func (*TimeRequest) XXX_DiscardUnknown

func (m *TimeRequest) XXX_DiscardUnknown()

func (*TimeRequest) XXX_Marshal

func (m *TimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimeRequest) XXX_Merge

func (m *TimeRequest) XXX_Merge(src proto.Message)

func (*TimeRequest) XXX_Size

func (m *TimeRequest) XXX_Size() int

func (*TimeRequest) XXX_Unmarshal

func (m *TimeRequest) XXX_Unmarshal(b []byte) error

type TimeResponse

type TimeResponse struct {
	Ts                   *types.Timestamp `protobuf:"bytes,1,opt,name=ts,proto3" json:"ts,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*TimeResponse) Descriptor

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

func (*TimeResponse) GetTs

func (m *TimeResponse) GetTs() *types.Timestamp

func (*TimeResponse) Marshal

func (m *TimeResponse) Marshal() (dAtA []byte, err error)

func (*TimeResponse) MarshalTo

func (m *TimeResponse) MarshalTo(dAtA []byte) (int, error)

func (*TimeResponse) MarshalToSizedBuffer

func (m *TimeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimeResponse) ProtoMessage

func (*TimeResponse) ProtoMessage()

func (*TimeResponse) Reset

func (m *TimeResponse) Reset()

func (*TimeResponse) Size

func (m *TimeResponse) Size() (n int)

func (*TimeResponse) String

func (m *TimeResponse) String() string

func (*TimeResponse) Unmarshal

func (m *TimeResponse) Unmarshal(dAtA []byte) error

func (*TimeResponse) XXX_DiscardUnknown

func (m *TimeResponse) XXX_DiscardUnknown()

func (*TimeResponse) XXX_Marshal

func (m *TimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimeResponse) XXX_Merge

func (m *TimeResponse) XXX_Merge(src proto.Message)

func (*TimeResponse) XXX_Size

func (m *TimeResponse) XXX_Size() int

func (*TimeResponse) XXX_Unmarshal

func (m *TimeResponse) XXX_Unmarshal(b []byte) error

type TimeServiceServer

type TimeServiceServer interface {
	Send(data *TimeResponse) error
	Context() context.Context
}

Jump to

Keyboard shortcuts

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