protodef

package
v0.0.0-...-236808b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoticeTypeInsertRemove int = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NoticeBase

type NoticeBase struct {
	Type int `json:"typ"`
}

func (*NoticeBase) Unmarshal

func (n *NoticeBase) Unmarshal(b []byte) error

type NoticeInsertRemove

type NoticeInsertRemove struct {
	Pos    QUEUEPOS `json:"pos"`
	Number int      `json:"num"`
	Length int      `json:"len"`
}

Notify the number of elements insert to (remove from) the queue at the pos.

insert : number < 0
remove : number > 0

func (*NoticeInsertRemove) Marshal

func (n *NoticeInsertRemove) Marshal() ([]byte, error)

func (*NoticeInsertRemove) Unmarshal

func (n *NoticeInsertRemove) Unmarshal(b []byte) error

type PopElement

type PopElement struct {
	Key string   `json:"key"`
	Val string   `json:"val"`
	Pos QUEUEPOS `json:"pos"`
}

type QUEUEPOS

type QUEUEPOS struct {
	Priority  int64
	TimeStamp int64
}

queue position

func (QUEUEPOS) Compare

func (v QUEUEPOS) Compare(a QUEUEPOS) int

return

<0 if v <  a
 0 if v == a
>0 if v >  a

func (QUEUEPOS) MarshalJSON

func (v QUEUEPOS) MarshalJSON() ([]byte, error)

func (*QUEUEPOS) Set

func (v *QUEUEPOS) Set(s string)

func (QUEUEPOS) String

func (v QUEUEPOS) String() string

func (*QUEUEPOS) UnmarshalJSON

func (v *QUEUEPOS) UnmarshalJSON(b []byte) error

func (QUEUEPOS) Valid

func (v QUEUEPOS) Valid() bool

Jump to

Keyboard shortcuts

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