source

package
v1.29.0-mobile.5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateConnected    = "connected"
	StateDisconnected = "disconnected"
	StateError        = "error"
)

Variables

This section is empty.

Functions

func ErrorValueStringAsIDNotValid

func ErrorValueStringAsIDNotValid(value string) error

func IDValidator

func IDValidator(value string, errorReporter structure.ErrorReporter)

func IsValidID

func IsValidID(value string) bool

func NewID

func NewID() string

func States

func States() []string

func ValidateID

func ValidateID(value string) error

Types

type Accessor

type Accessor interface {
	List(ctx context.Context, userID string, filter *Filter, pagination *page.Pagination) (Sources, error)
	Create(ctx context.Context, userID string, create *Create) (*Source, error)
	Get(ctx context.Context, id string) (*Source, error)
	Update(ctx context.Context, id string, condition *request.Condition, update *Update) (*Source, error)
	Delete(ctx context.Context, id string, condition *request.Condition) (bool, error)
}

type Client

type Client interface {
	Accessor
}

type Create

type Create struct {
	ProviderType      *string `json:"providerType,omitempty"`
	ProviderName      *string `json:"providerName,omitempty"`
	ProviderSessionID *string `json:"providerSessionId,omitempty"`
	State             *string `json:"state,omitempty"`
}

func NewCreate

func NewCreate() *Create

func (*Create) Parse

func (c *Create) Parse(parser structure.ObjectParser)

func (*Create) Validate

func (c *Create) Validate(validator structure.Validator)

type Filter

type Filter struct {
	ProviderType      *[]string
	ProviderName      *[]string
	ProviderSessionID *[]string
	State             *[]string
}

func NewFilter

func NewFilter() *Filter

func (*Filter) MutateRequest

func (f *Filter) MutateRequest(req *http.Request) error

func (*Filter) Parse

func (f *Filter) Parse(parser structure.ObjectParser)

func (*Filter) Validate

func (f *Filter) Validate(validator structure.Validator)

type Source

type Source struct {
	ID                *string              `json:"id,omitempty" bson:"id,omitempty"`
	UserID            *string              `json:"userId,omitempty" bson:"userId,omitempty"`
	ProviderType      *string              `json:"providerType,omitempty" bson:"providerType,omitempty"`
	ProviderName      *string              `json:"providerName,omitempty" bson:"providerName,omitempty"`
	ProviderSessionID *string              `json:"providerSessionId,omitempty" bson:"providerSessionId,omitempty"`
	State             *string              `json:"state,omitempty" bson:"state,omitempty"`
	Error             *errors.Serializable `json:"error,omitempty" bson:"error,omitempty"`
	DataSetIDs        *[]string            `json:"dataSetIds,omitempty" bson:"dataSetIds,omitempty"`
	EarliestDataTime  *time.Time           `json:"earliestDataTime,omitempty" bson:"earliestDataTime,omitempty"`
	LatestDataTime    *time.Time           `json:"latestDataTime,omitempty" bson:"latestDataTime,omitempty"`
	LastImportTime    *time.Time           `json:"lastImportTime,omitempty" bson:"lastImportTime,omitempty"`
	CreatedTime       *time.Time           `json:"createdTime,omitempty" bson:"createdTime,omitempty"`
	ModifiedTime      *time.Time           `json:"modifiedTime,omitempty" bson:"modifiedTime,omitempty"`
	Revision          *int                 `json:"revision,omitempty" bson:"revision,omitempty"`
}

func (*Source) Normalize

func (s *Source) Normalize(normalizer structure.Normalizer)

func (*Source) Parse

func (s *Source) Parse(parser structure.ObjectParser)

func (*Source) Sanitize

func (s *Source) Sanitize(details request.Details) error

func (*Source) Validate

func (s *Source) Validate(validator structure.Validator)

type Sources

type Sources []*Source

func (Sources) Sanitize

func (s Sources) Sanitize(details request.Details) error

type Update

type Update struct {
	State            *string              `json:"state,omitempty"`
	Error            *errors.Serializable `json:"error,omitempty"`
	DataSetIDs       *[]string            `json:"dataSetIds,omitempty"`
	EarliestDataTime *time.Time           `json:"earliestDataTime,omitempty"`
	LatestDataTime   *time.Time           `json:"latestDataTime,omitempty"`
	LastImportTime   *time.Time           `json:"lastImportTime,omitempty"`
}

func NewUpdate

func NewUpdate() *Update

func (*Update) HasUpdates

func (u *Update) HasUpdates() bool

func (*Update) Normalize

func (u *Update) Normalize(normalizer structure.Normalizer)

func (*Update) Parse

func (u *Update) Parse(parser structure.ObjectParser)

func (*Update) Validate

func (u *Update) Validate(validator structure.Validator)

Directories

Path Synopsis
service
store

Jump to

Keyboard shortcuts

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