storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("not found")
	ErrNoResults      = errors.New("no results")
	ErrNotImplemented = errors.New("method not implemented")
)

Functions

This section is empty.

Types

type FindProfileIDsFunc

type FindProfileIDsFunc func(ctx context.Context, params *FindProfilesParams) ([]profile.ID, error)

type FindProfilesFunc

type FindProfilesFunc func(ctx context.Context, params *FindProfilesParams) ([]profile.Meta, error)

type FindProfilesParams

type FindProfilesParams struct {
	Service      string
	Type         profile.ProfileType
	Labels       profile.Labels
	CreatedAtMin time.Time
	CreatedAtMax time.Time
	Limit        int
}

func (*FindProfilesParams) Validate

func (params *FindProfilesParams) Validate() error

type ListProfilesFunc

type ListProfilesFunc func(ctx context.Context, pid []profile.ID) (ProfileList, error)

type ListServicesFunc

type ListServicesFunc func(ctx context.Context) ([]string, error)

type MultiWriter

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

func NewMultiWriter

func NewMultiWriter(writers ...Writer) *MultiWriter

func (*MultiWriter) WriteProfile

func (mw *MultiWriter) WriteProfile(ctx context.Context, params *WriteProfileParams, r io.Reader) (profile.Meta, error)

type ProfileList

type ProfileList interface {
	Next() bool
	Profile() (io.Reader, error)
	Close() error
}

type Reader

type Reader interface {
	FindProfiles(ctx context.Context, params *FindProfilesParams) ([]profile.Meta, error)
	FindProfileIDs(ctx context.Context, params *FindProfilesParams) ([]profile.ID, error)
	ListProfiles(ctx context.Context, pid []profile.ID) (ProfileList, error)
	ListServices(ctx context.Context) ([]string, error)
}

type Storage

type Storage interface {
	Writer
	Reader
}

type StubReader

func (*StubReader) FindProfileIDs

func (sr *StubReader) FindProfileIDs(ctx context.Context, params *FindProfilesParams) ([]profile.ID, error)

func (*StubReader) FindProfiles

func (sr *StubReader) FindProfiles(ctx context.Context, params *FindProfilesParams) ([]profile.Meta, error)

func (*StubReader) ListProfiles

func (sr *StubReader) ListProfiles(ctx context.Context, pid []profile.ID) (ProfileList, error)

func (*StubReader) ListServices

func (sr *StubReader) ListServices(ctx context.Context) ([]string, error)

type StubWriter

type StubWriter struct {
	WriteProfileFunc
}

func (*StubWriter) WriteProfile

func (sw *StubWriter) WriteProfile(ctx context.Context, params *WriteProfileParams, r io.Reader) (profile.Meta, error)

type WriteProfileFunc

type WriteProfileFunc func(ctx context.Context, params *WriteProfileParams, r io.Reader) (profile.Meta, error)

type WriteProfileParams

type WriteProfileParams struct {
	ExternalID profile.ID
	Service    string
	Type       profile.ProfileType
	Labels     profile.Labels
	CreatedAt  time.Time
}

func (*WriteProfileParams) Validate

func (params *WriteProfileParams) Validate() error

type Writer

type Writer interface {
	WriteProfile(ctx context.Context, params *WriteProfileParams, r io.Reader) (profile.Meta, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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