internal

package
v0.0.0-...-947ae47 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(ctx context.Context, dst store.Store, src Source) error

Copy creates a new identity in dst for every identity retreived from src.

func SplitStoreSpecification

func SplitStoreSpecification(s string) (type_, addr string)

SplitStoreSpecification splits a store specification string as supplied in the command line arguments into a type and address.

Types

type LegacySource

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

A LegacySource is a Source from a legacy mgo store.

func NewLegacySource

func NewLegacySource(db *mgo.Database) *LegacySource

NewLegacySource creates a LegacySource from the given database.

func (*LegacySource) Err

func (s *LegacySource) Err() error

Err implements Source.Err.

func (*LegacySource) Identity

func (s *LegacySource) Identity() *store.Identity

Identity implements Source.Identity.

func (*LegacySource) Next

func (s *LegacySource) Next() bool

Next implements Source.Next.

type Source

type Source interface {
	// Next fetches the next identity from the source. Next returns
	// true if the identity was successfully fetched. If there are no
	// more identities, or an error occurs then false is returned,
	// the Err method can be used to determine which.
	Next() bool

	// Identity returns the current identity for the source. The
	// pointer is only valid unti Next is called again.
	Identity() *store.Identity

	// Err returns any error received whilst getting identities.
	Err() error
}

A Source is the interface that Copy uses to collect migrated identitites from.

type StoreSource

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

A StoreSource is a Source that wraps a store.Store.

func NewStoreSource

func NewStoreSource(ctx context.Context, st store.Store) *StoreSource

NewStoreSource creates a new StoreSource that use the given store for its source of identities.

func (*StoreSource) Err

func (s *StoreSource) Err() error

Err implements Source.Err.

func (*StoreSource) Identity

func (s *StoreSource) Identity() *store.Identity

Identity implements Source.Identity.

func (*StoreSource) Next

func (s *StoreSource) Next() bool

Next implements Source.Next.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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