store

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken string

func (AccessToken) GetSubject

func (t AccessToken) GetSubject() (string, error)

func (AccessToken) String

func (t AccessToken) String() string

type Endpoint

type Endpoint struct {
	URL                string   `json:"URL"`
	RootCAs            []string `json:"RootCAs"`
	InsecureSkipVerify bool     `json:"InsecureSkipVerify"`
	UseSystemCAs       bool     `json:"UseSystemCAs"`
}

type Events

type Events struct {
	Devices            []events.EventType `json:"Devices"`
	Device             []events.EventType `json:"Device"`
	Resource           []events.EventType `json:"Resource"`
	StaticDeviceEvents bool               `json:"StaticDeviceEvents"`
}

func (Events) NeedPullDevice

func (e Events) NeedPullDevice() bool

func (Events) NeedPullDevices

func (e Events) NeedPullDevices() bool

func (Events) NeedPullResources

func (e Events) NeedPullResources() bool

type LinkedAccount

type LinkedAccount struct {
	ID            string `json:"Id" bson:"_id"`
	LinkedCloudID string `bson:"linkedcloudid"`
	UserID        string
	TargetCloud   Token
}

type LinkedAccountHandler

type LinkedAccountHandler interface {
	Handle(ctx context.Context, iter LinkedAccountIter) (err error)
}

type LinkedAccountIter

type LinkedAccountIter interface {
	Next(ctx context.Context, sub *LinkedAccount) bool
	Err() error
}

type LinkedCloud

type LinkedCloud struct {
	ID                           string       `json:"Id" bson:"_id"`
	Name                         string       `json:"Name"`
	OAuth                        oauth.Config `json:"OAuth"`
	SupportedSubscriptionsEvents Events       `json:"SupportedSubscriptionEvents"`
	Endpoint                     Endpoint     `json:"Endpoint"`
}

func (LinkedCloud) CtxWithHTTPClient

func (l LinkedCloud) CtxWithHTTPClient(ctx context.Context) context.Context

func (LinkedCloud) GetHTTPClient

func (l LinkedCloud) GetHTTPClient() *http.Client

type LinkedCloudHandler

type LinkedCloudHandler interface {
	Handle(ctx context.Context, iter LinkedCloudIter) (err error)
}

type LinkedCloudIter

type LinkedCloudIter interface {
	Next(ctx context.Context, sub *LinkedCloud) bool
	Err() error
}

type LinkedCloudsHandler

type LinkedCloudsHandler struct {
	LinkedClouds []LinkedCloud
}

func (*LinkedCloudsHandler) Handle

func (h *LinkedCloudsHandler) Handle(ctx context.Context, iter LinkedCloudIter) (err error)

type Query

type Query struct {
	ID            string
	LinkedCloudID string
}

type Store

type Store interface {
	UpdateLinkedCloud(ctx context.Context, sub LinkedCloud) error
	InsertLinkedCloud(ctx context.Context, sub LinkedCloud) error
	RemoveLinkedCloud(ctx context.Context, ConfigId string) error
	LoadLinkedClouds(ctx context.Context, query Query, h LinkedCloudHandler) error

	UpdateLinkedAccount(ctx context.Context, sub LinkedAccount) error
	InsertLinkedAccount(ctx context.Context, sub LinkedAccount) error
	RemoveLinkedAccount(ctx context.Context, LinkedAccountId string) error
	LoadLinkedAccounts(ctx context.Context, query Query, h LinkedAccountHandler) error
}

type Token

type Token struct {
	AccessToken  AccessToken
	RefreshToken string
	Expiry       time.Time
}

func (Token) GetAccessToken

func (o Token) GetAccessToken() (AccessToken, error)

func (Token) IsValidAccessToken

func (o Token) IsValidAccessToken() bool

func (Token) Refresh

func (o Token) Refresh(ctx context.Context, cfg oauth2.Config) (Token, bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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