groups

package
v0.0.0-...-5dcd16a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendTable

type BackendTable interface {
	// ids must be byte arrays.
	GetPairs([]interface{}) ([]TablePair, error)
	SetPairs([]TablePair) error
}

type GhaClient

type GhaClient struct {
	sync.Mutex
	R *bufio.Reader
	W *bufio.Writer
	// contains filtered or unexported fields
}

func (*GhaClient) AdmCreateGroup

func (g *GhaClient) AdmCreateGroup(group []byte) int

func (*GhaClient) GetDown

func (g *GhaClient) GetDown(group []byte) (int64, error)

func (*GhaClient) GroupHeadInsert

func (g *GhaClient) GroupHeadInsert(groups [][]byte, buf []int64) ([]int64, error)

func (*GhaClient) GroupHeadRevert

func (g *GhaClient) GroupHeadRevert(groups [][]byte, nums []int64) error

func (*GhaClient) MoveDown

func (g *GhaClient) MoveDown(group []byte) (int64, error)

func (*GhaClient) UpdateDown

func (g *GhaClient) UpdateDown(group []byte, oldHigh, low, high, count int64) (bool, error)

type GhaServer

type GhaServer struct {
	R   *bufio.Reader
	W   *bufio.Writer
	Obj *GroupHeadActor
	// contains filtered or unexported fields
}

func (*GhaServer) Serve

func (g *GhaServer) Serve() error

type GroupEntry

type GroupEntry struct {
	Low1, High1, Count1 int64
	Low2, High2, Count2 int64
	Flags               int // We'll propably need it later!
	// contains filtered or unexported fields
}

func (*GroupEntry) HlStats

func (g *GroupEntry) HlStats() (low, high, count int64)

func (*GroupEntry) Increment

func (g *GroupEntry) Increment() int64

func (*GroupEntry) MoveDown

func (g *GroupEntry) MoveDown()

func (*GroupEntry) Rollback

func (g *GroupEntry) Rollback(i int64)

func (*GroupEntry) UpdateDown

func (g *GroupEntry) UpdateDown(oldhigh, low, high, count int64) bool

type GroupHeadActor

type GroupHeadActor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewGroupHeadActor

func NewGroupHeadActor(bt BackendTable) *GroupHeadActor

func (*GroupHeadActor) AdmCreateGroup

func (g *GroupHeadActor) AdmCreateGroup(group []byte) int

func (*GroupHeadActor) GetDown

func (g *GroupHeadActor) GetDown(group []byte) (int64, error)

func (*GroupHeadActor) GroupHeadInsert

func (g *GroupHeadActor) GroupHeadInsert(groups [][]byte, buf []int64) ([]int64, error)

func (*GroupHeadActor) GroupHeadRevert

func (g *GroupHeadActor) GroupHeadRevert(groups [][]byte, nums []int64) error

func (*GroupHeadActor) HlStats

func (g *GroupHeadActor) HlStats(group []byte) (low, high, count int64, err error)

This function exist for debug-purposes only.

func (*GroupHeadActor) MoveDown

func (g *GroupHeadActor) MoveDown(group []byte) (int64, error)

func (*GroupHeadActor) UpdateDown

func (g *GroupHeadActor) UpdateDown(group []byte, oldHigh, low, high, count int64) (bool, error)

type GroupOverview

type GroupOverview struct {
	Overview *GroupOverviewStatic
	// This should be the same table, that is also used by GroupHeadActor.
	Realtime BackendTable
}

func (*GroupOverview) GroupHeadFilter

func (g *GroupOverview) GroupHeadFilter(groups [][]byte) ([][]byte, error)

func (*GroupOverview) GroupRealtimeList

func (g *GroupOverview) GroupRealtimeList(targ func(group []byte, high, low int64, status byte)) bool

func (*GroupOverview) GroupRealtimeQuery

func (g *GroupOverview) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)

func (*GroupOverview) GroupStaticList

func (g *GroupOverview) GroupStaticList(targ func(group []byte, descr []byte)) bool

type GroupOverviewStatic

type GroupOverviewStatic struct {
	Map    map[string]TablePair
	Array  []string
	IArray map[string]int // Inverse array
}

func ImportGroupOverviewStatic

func ImportGroupOverviewStatic(i ImportTable) (*GroupOverviewStatic, error)

type ImportTable

type ImportTable interface {
	// Reads the table.
	GetTable() ([]TablePair, error)
}

type TablePair

type TablePair struct {
	GroupID []byte
	Value   []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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