store

package
v2.3.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 `bson:"_id"`
	LinkedCloudID string `bson:"linkedcloudid"`
	UserID        string
	Data          LinkedAccountData
}

type LinkedAccountData

type LinkedAccountData struct {
	OriginCloud oauth2.Token
	TargetCloud oauth2.Token
	State       LinkedAccountDataFlags
}

func MakeLinkedAccountData

func MakeLinkedAccountData(originCloud, targetCloud oauth2.Token) LinkedAccountData

Create linked data with existing origin cloud and target cloud account

func (LinkedAccountData) HasOrigin

func (d LinkedAccountData) HasOrigin() bool

func (LinkedAccountData) HasTarget

func (d LinkedAccountData) HasTarget() bool

func (LinkedAccountData) Origin

func (d LinkedAccountData) Origin() oauth2.Token

func (LinkedAccountData) SetOrigin

func (d LinkedAccountData) SetOrigin(originCloud oauth2.Token) LinkedAccountData

func (LinkedAccountData) SetTarget

func (d LinkedAccountData) SetTarget(targetCloud oauth2.Token) LinkedAccountData

func (LinkedAccountData) Target

func (d LinkedAccountData) Target() oauth2.Token

type LinkedAccountDataFlags

type LinkedAccountDataFlags uint8

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"`
	SupportedSubscriptionEvents Events       `json:"supportedSubscriptionEvents"`
	Endpoint                    Endpoint     `json:"endpoint"`
}

https://github.com/plgd-dev/hub/blob/main/cloud2cloud-connector/swagger.yaml#/components/schemas/LinkedCloud

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

	Close(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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