segment

package
v0.0.0-...-41ff29f Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MAX_STEP         = 1000000
	SEGMENT_DURATION = 15 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo interface {
	GetAllLeafAllocs(ctx context.Context) ([]*entity.LeafAlloc, error)
	UpdateMaxIdAndGetLeafAlloc(ctx context.Context, tag string) (*entity.LeafAlloc, error)
	UpdateMaxIdByCustomStepAndGetLeafAlloc(ctx context.Context, leafAlloc *entity.LeafAlloc) (*entity.LeafAlloc, error)
	GetAllTags(ctx context.Context) ([]string, error)
}

type SegmentImpl

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

[string]*entity.SegmentBuffer

func NewSegmentImpl

func NewSegmentImpl(repo Repo) *SegmentImpl

func (*SegmentImpl) Get

func (s *SegmentImpl) Get(ctx context.Context, key string) (int64, error)

func (*SegmentImpl) Init

func (s *SegmentImpl) Init() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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