models

package
v0.0.0-...-a69402d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXCEPTION_ID_IDCACHE_INIT_FALSE    ExceptionCode = -1
	EXCEPTION_ID_KEY_NOT_EXISTS                      = -2
	EXCEPTION_ID_TWO_SEGMENTS_ARE_NULL               = -3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExceptionCode

type ExceptionCode int

type Result

type Result struct {
	Id     int64  `json:"id"`
	Status Status `json:"status"`
}

func NewResult

func NewResult(id int64, status Status) Result

func (*Result) GetId

func (p *Result) GetId() int64

func (*Result) GetStatus

func (p *Result) GetStatus() Status

func (*Result) SetId

func (p *Result) SetId(id int64)

func (*Result) SetStatus

func (p *Result) SetStatus(status Status)

type Segment

type Segment struct {
	Value *atomic.Int64
	Max   int64
	Step  int
}

type SegmentBuffer

type SegmentBuffer struct {
	Key           string
	RWMutex       *sync.RWMutex
	CurrentPos    int
	NextReady     bool
	InitOk        bool
	ThreadRunning *atomic.Bool
	Step          int
	MinStep       int
	UpdatedAt     int64
}

type SegmentBufferView

type SegmentBufferView struct {
	Key       string
	Value0    int64
	Step0     int
	Max0      int64
	Value1    int64
	Step1     int
	Max1      int64
	Pos       int
	NextReady bool
	InitOk    bool
}

type Status

type Status int
const (
	SUCCESS   Status = 0
	EXCEPTION Status = 1
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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