cdkey

package
v2.10.18 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReachMaxTimes = errors.New("reach max create times")
	ErrMinNumOne     = errors.New("min create num one")
	ErrInvalidCode   = errors.New("invalid code")
)

Functions

This section is empty.

Types

type CdkeyManager

type CdkeyManager interface {
	MakeCode(relationId int64) string
	IsCodeExist(code string) bool
	CodeStore(relationId int64, code string) error
	IsCodeValid(code string) (bool, int64)
	CodeExchange(relationId int64, code string) error
}

type CdkeyProducer

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

func NewCdkeyProducer

func NewCdkeyProducer(mgr CdkeyManager) *CdkeyProducer

func (*CdkeyProducer) ExchangeCode

func (m *CdkeyProducer) ExchangeCode(code string) error

func (*CdkeyProducer) GenCode

func (m *CdkeyProducer) GenCode(relationId int64, max, cur int) (string, error)

func (*CdkeyProducer) GenCodes

func (m *CdkeyProducer) GenCodes(relationId int64, num, max int) ([]string, error)

Jump to

Keyboard shortcuts

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