tagsvc

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

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

Go to latest
Published: Sep 19, 2015 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CHALLENGE_SIZE int = 64
View Source
const GREETING string = "minion_v1\n"

Variables

View Source
var NO_SUCH_KEY error = errors.New("No such key")

Functions

func ComputeResponse

func ComputeResponse(secret []byte, client []byte, server []byte) []byte

func NewTagService

func NewTagService(c *Client) v2.TagService

func RandomChallenge

func RandomChallenge() []byte

func StartServer

func StartServer(config *Config) (net.Listener, error)

Types

type AddLeaseArgs

type AddLeaseArgs struct {
	Timeout uint64
	Key     *v2.Key
}

type Client

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

func NewClient

func NewClient(address string, authSecret []byte) *Client

func (*Client) AddLease

func (c *Client) AddLease(Timeout uint64, Key *v2.Key) error

func (*Client) Get

func (c *Client) Get(label string) (*v2.Key, error)

func (*Client) GetAll

func (c *Client) GetAll() ([]NameAndKey, error)

func (*Client) GetConfig

func (c *Client) GetConfig() (*Config, error)

func (*Client) Set

func (c *Client) Set(label string, key *v2.Key) error

type Color

type Color int
const (
	UNDEFINED Color = iota
	WHITE
	GRAY
	BLACK
)

type Coloring

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

type Config

type Config struct {
	AccessKeyId     string
	SecretAccessKey string
	Endpoint        string
	Bucket          string
	MasterPort      int
	Prefix          string
	PersistPath     string
	AuthSecret      string
}

type FreeCallback

type FreeCallback func(key *v2.Key)

type KeyLease

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

type Leases

type Leases []KeyLease

func (Leases) Len

func (l Leases) Len() int

func (Leases) Less

func (l Leases) Less(i, j int) bool

func (*Leases) Peek

func (l *Leases) Peek() KeyLease

func (*Leases) Pop

func (l *Leases) Pop() interface{}

func (*Leases) Push

func (l *Leases) Push(x interface{})

func (Leases) Swap

func (l Leases) Swap(i, j int)

type Log

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

func OpenLog

func OpenLog(filename string, replayLabel func(label string, key *v2.Key), replayLease func(key *v2.Key, timestamp uint64)) *Log

func (*Log) Close

func (log *Log) Close()

type Master

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

func (*Master) AddLease

func (t *Master) AddLease(args *AddLeaseArgs, reply *bool) error

func (*Master) GC

func (t *Master) GC(label *string, reply *v2.Key) error

func (*Master) Get

func (t *Master) Get(label *string, reply *v2.Key) error

func (*Master) GetAll

func (t *Master) GetAll(ignored *string, reply *[]NameAndKey) error

func (*Master) GetConfig

func (t *Master) GetConfig(nothing *string, reply *Config) error

func (*Master) Set

func (t *Master) Set(args *SetArgs, reply *bool) error

type NameAndKey

type NameAndKey struct {
	Name string
	Key  *v2.Key
}

type Roots

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

func NewRoots

func NewRoots(logName string) *Roots

func (*Roots) AddLease

func (r *Roots) AddLease(expiry uint64, key *v2.Key)

func (*Roots) Expire

func (r *Roots) Expire(oldestToKeep uint64) []*v2.Key

Find all leases which have expired, remove them and return the list of the removed

func (*Roots) GC

func (r *Roots) GC(dirService v2.DirectoryService, chunks v2.IterableChunkService, freeCallback FreeCallback)

func (*Roots) Get

func (r *Roots) Get(label string) *v2.Key

func (*Roots) GetNamedRoots

func (r *Roots) GetNamedRoots() []NameAndKey

return a snapshot of all root keeps to be used for reachability analysis

func (*Roots) GetRoots

func (r *Roots) GetRoots() []*v2.Key

func (*Roots) Set

func (r *Roots) Set(label string, key *v2.Key)

type SetArgs

type SetArgs struct {
	Label string
	Key   *v2.Key
}

type TagService

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

func (*TagService) ForEach

func (t *TagService) ForEach(callback func(name string, key *v2.Key))

func (*TagService) Get

func (t *TagService) Get(name string) (*v2.Key, error)

func (*TagService) Put

func (t *TagService) Put(name string, key *v2.Key) error

Jump to

Keyboard shortcuts

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