source

package
v1.32.2-hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 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 Client

type Client interface {
	List(ctx context.Context, userID string, filter *Filter, pagination *page.Pagination) (SourceArray, error)
	Create(ctx context.Context, userID string, create *Create) (*Source, error)
	DeleteAll(ctx context.Context, userID string) 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 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 SourceArray added in v1.31.0

type SourceArray []*Source

func (SourceArray) Sanitize added in v1.31.0

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

type Update

type Update struct {
	ProviderSessionID *string              `json:"providerSessionId,omitempty"`
	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) IsEmpty added in v1.31.0

func (u *Update) IsEmpty() 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