event

package
v0.0.0-...-7afda5e Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID       string
	Type     Type
	DateTime time.Time
	Retry    bool
}

func (*Base) GetDateTime

func (o *Base) GetDateTime() time.Time

func (*Base) GetID

func (o *Base) GetID() string

func (*Base) GetType

func (o *Base) GetType() Type

func (*Base) SetID

func (o *Base) SetID(id string)

func (*Base) String

func (o *Base) String() string

type CommentEvent

type CommentEvent struct {
	*Base
	UserID  uint64
	Comment string
}

func (*CommentEvent) MarshalBinary

func (o *CommentEvent) MarshalBinary() (data []byte, err error)

func (*CommentEvent) UnmarshalBinary

func (o *CommentEvent) UnmarshalBinary(data []byte) error

type Event

type Event interface {
	GetID() string
	GetType() Type
	GetDateTime() time.Time
	SetID(id string)
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

Event ...

func New

func New(t Type) (Event, error)

type LikeEvent

type LikeEvent struct {
	*Base
	UserID uint64
}

func (*LikeEvent) MarshalBinary

func (o *LikeEvent) MarshalBinary() (data []byte, err error)

func (*LikeEvent) UnmarshalBinary

func (o *LikeEvent) UnmarshalBinary(data []byte) error

type Type

type Type string
const (
	LikeType    Type = "LikeType"
	CommentType Type = "CommentType"
)

Jump to

Keyboard shortcuts

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