segment

package
v0.0.0-...-cb7ffae Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed         = errors.New("service closed")
	ErrBizTagNotFound = errors.New("biztag not found")
)

Functions

This section is empty.

Types

type Repository

type Repository interface {
	List(ctx context.Context) ([]*Segment, error)
	Get(ctx context.Context, biztag string) (*Segment, error)
	UpdateMaxID(ctx context.Context, biztag string) (*Segment, error)
	UpdateMaxIDWithStep(ctx context.Context, biztag string, step int32) (*Segment, error)
	ListBizTags(ctx context.Context) ([]string, error)
}

func NewDefaultRepository

func NewDefaultRepository(db *sql.DB) (Repository, error)

type Segment

type Segment struct {
	BizTag      string
	MaxID       int64
	Step        int32
	Description string
	Updated     time.Time
}

type Service

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

func NewService

func NewService(repo Repository, logger log.Logger) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) Get

func (s *Service) Get(ctx context.Context, biztag string, count int) (ids []int64, err error)

Jump to

Keyboard shortcuts

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