m365

package
v0.0.0-...-df423d5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoResourceLookup = clues.New("missing resource lookup client")

Functions

This section is empty.

Types

type Controller

type Controller struct {
	AC api.Client

	// maps of resource owner ids to names, and names to ids.
	// not guaranteed to be populated, only here as a post-population
	// reference for processes that choose to populate the values.
	IDNameLookup idname.Cacher
	// contains filtered or unexported fields
}

Controller is a struct used to wrap the GraphServiceClient and GraphRequestAdapter from the msgraph-sdk-go. Additional fields are for bookkeeping and interfacing with other component.

func NewController

func NewController(
	ctx context.Context,
	acct account.Account,
	pst path.ServiceType,
	co control.Options,
	counter *count.Bus,
) (*Controller, error)

func (*Controller) CacheItemInfo

func (ctrl *Controller) CacheItemInfo(dii details.ItemInfo)

func (*Controller) DeserializeMetadataFiles

func (ctrl *Controller) DeserializeMetadataFiles(
	ctx context.Context,
	colls []data.RestoreCollection,
) ([]store.MetadataFile, error)

func (*Controller) GetMetadataPaths

func (ctrl *Controller) GetMetadataPaths(
	ctx context.Context,
	r kinject.RestoreProducer,
	base inject.ReasonAndSnapshotIDer,
	errs *fault.Bus,
) ([]path.RestorePaths, error)

func (*Controller) IsServiceEnabled

func (ctrl *Controller) IsServiceEnabled(
	ctx context.Context,
	service path.ServiceType,
	resourceOwner string,
) (bool, error)

func (*Controller) NewServiceHandler

func (ctrl *Controller) NewServiceHandler(
	service path.ServiceType,
) (inject.ServiceHandler, error)

NewServiceHandler returns an instance of a struct capable of running various operations for a given service.

func (*Controller) PopulateProtectedResourceIDAndName

func (ctrl *Controller) PopulateProtectedResourceIDAndName(
	ctx context.Context,
	resourceID string,
	ins idname.Cacher,
) (idname.Provider, error)

PopulateProtectedResourceIDAndName takes the provided owner identifier and produces the owner's name and ID from that value. Returns an error if the owner is not recognized by the current tenant.

The id-name cacher is optional. Some processes will look up all owners in the tenant before reaching this step. In that case, the data gets handed down for this func to consume instead of performing further queries. The data gets stored inside the controller instance for later re-use.

func (*Controller) PrintableStatus

func (ctrl *Controller) PrintableStatus() string

PrintableStatus returns a string formatted version of the status.

func (*Controller) ProduceBackupCollections

func (ctrl *Controller) ProduceBackupCollections(
	ctx context.Context,
	bpc inject.BackupProducerConfig,
	counter *count.Bus,
	errs *fault.Bus,
) ([]data.BackupCollection, prefixmatcher.StringSetReader, bool, error)

ProduceBackupCollections generates a slice of data.BackupCollections for the service specified in the selectors. The metadata field can include things like delta tokens or the previous backup's folder hierarchy. The absence of metadata causes the collection creation to ignore prior history (ie, incrementals) and run a full backup.

func (*Controller) SetRateLimiter

func (ctrl *Controller) SetRateLimiter(
	ctx context.Context,
	service path.ServiceType,
	options control.Options,
) context.Context

func (*Controller) Status

Status returns the current status of the controller process.

func (*Controller) UpdateStatus

func (ctrl *Controller) UpdateStatus(status *support.ControllerOperationStatus)

UpdateStatus is used by initiated tasks to indicate completion

func (*Controller) VerifyAccess

func (ctrl *Controller) VerifyAccess(ctx context.Context) error

func (*Controller) Wait

func (ctrl *Controller) Wait() *data.CollectionStats

AwaitStatus waits for all tasks to complete and then returns status

Directories

Path Synopsis
collection
exchange
Package exchange provides support for retrieving M365 Exchange objects from M365 servers using the Graph API.
Package exchange provides support for retrieving M365 Exchange objects from M365 servers using the Graph API.
service

Jump to

Keyboard shortcuts

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