sea

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

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

Go to latest
Published: Feb 27, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MIN_COUNT = int64(10000)
View Source
var NAMESPACE_XUEQIU_FOLLOWER = "com.xueqiu:follower:"
View Source
var NAMESPACE_XUEQIU_USER = "com.xueqiu:user:"
View Source
var OFFSET = int64(400)

Functions

This section is empty.

Types

type DbOp

type DbOp interface {

	//check if user is existed
	UserExisted(id string) bool
	//add a user
	AddUser(id string, v *map[string]string) error
	//get user all info
	GetUserAll(id string) (v *map[string]string, err error)
	//get user specific info
	//GetUserInfo(id string) (info string, err error)
	//delete a user
	DeleteUser(id string) error
}

type SeaClient

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

func NewSeaClient

func NewSeaClient() (sea *SeaClient, err error)

create a new client

func (*SeaClient) AddPreparation

func (sc *SeaClient) AddPreparation(id string, override bool, more ...string) error

func (*SeaClient) AddUser

func (sc *SeaClient) AddUser(id string, v *map[string]string) (err error)

func (*SeaClient) ClearAllSeeds

func (sc *SeaClient) ClearAllSeeds()

func (*SeaClient) Close

func (sc *SeaClient) Close()

close the connection

func (*SeaClient) DeleteUser

func (sc *SeaClient) DeleteUser(id string) (err error)

func (*SeaClient) GetSeed

func (sc *SeaClient) GetSeed(pick func(interface{}) bool) (id string, err error)

generate seed from users by scan hmap skip users which are seed already or have less than

func (*SeaClient) GetUserAll

func (sc *SeaClient) GetUserAll(id string) (v *map[string]string, err error)

func (*SeaClient) MarkSeed

func (sc *SeaClient) MarkSeed(id string) (err error)

func (*SeaClient) UnmarkSeed

func (sc *SeaClient) UnmarkSeed(id string) (err error)

func (*SeaClient) UserExisted

func (sc *SeaClient) UserExisted(id string) (b bool)

interfaces

func (*SeaClient) UserIsSeed

func (sc *SeaClient) UserIsSeed(id string) (b bool)

used to be seed or not

type SeedOp

type SeedOp interface {
	//add id as preparation
	AddPreparation(id string, override bool, more ...string) error
	//delete all seed data including preparation id
	ClearAllSeeds()

	//check if user is a seed
	UserIsSeed(id string) bool
	//mark user as a seed. if user does not exist, add it
	MarkSeed(id string) error
	//unmark user
	UnmarkSeed(id string) error
	//unmark all seeds
	//UnmarkAllSeeds()
	//pick a user as seed, user will be mark as seed
	GetSeed(pick func(interface{}) bool) (id string, err error)
}

Jump to

Keyboard shortcuts

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