fake

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertPolicies

type AlertPolicies struct {
	// contains filtered or unexported fields
}

AlertPolicies implements the AlertPolicies API.

func (*AlertPolicies) Create

func (ap *AlertPolicies) Create(_ context.Context, payload model.AlertPolicy) (*model.AlertPolicy, error)

Create implements the AlertPolicy API.

func (*AlertPolicies) Delete

func (ap *AlertPolicies) Delete(_ context.Context, policyName string) error

Delete implements the AlertPolicy API.

func (*AlertPolicies) Get

func (ap *AlertPolicies) Get(_ context.Context, policyName string) (*model.AlertPolicy, error)

Get implements the AlertPolicy API.

func (*AlertPolicies) List

List implements the buckets API.

func (*AlertPolicies) Update

func (ap *AlertPolicies) Update(_ context.Context, payload model.AlertPolicy, policyName string) (*model.AlertPolicy, error)

Update implements the AlertPolicy API.

type AlertPolicy

type AlertPolicy struct {
	AlertPolicy *model.AlertPolicy
}

AlertPolicy implements the AlertPolicy API.

type BucketPolicy

type BucketPolicy struct {
	BucketName string
	Policy     string
	Namespace  string
}

BucketPolicy contains information about bucket policy to be used in fake client set.

type Buckets

type Buckets struct {
	// contains filtered or unexported fields
}

Buckets implements the buckets API.

func (*Buckets) Create

func (b *Buckets) Create(_ context.Context, createParams model.Bucket) (*model.Bucket, error)

Create implements the buckets API.

func (*Buckets) Delete

func (b *Buckets) Delete(_ context.Context, name string, namespace string, _ bool) error

Delete implements the buckets API.

func (*Buckets) DeletePolicy

func (b *Buckets) DeletePolicy(_ context.Context, bucketName string, params map[string]string) error

DeletePolicy implements the buckets API.

func (*Buckets) DeleteQuota

func (b *Buckets) DeleteQuota(_ context.Context, bucketName string, _ string) error

DeleteQuota deletes the quota setting for the given bucket and namespace.

func (*Buckets) Get

func (b *Buckets) Get(_ context.Context, name string, params map[string]string) (*model.Bucket, error)

Get implements the buckets API.

func (*Buckets) GetPolicy

func (b *Buckets) GetPolicy(_ context.Context, bucketName string, params map[string]string) (string, error)

GetPolicy implements the buckets API.

func (*Buckets) GetQuota

func (b *Buckets) GetQuota(_ context.Context, bucketName string, _ string) (*model.BucketQuotaInfo, error)

GetQuota gets the quota for the given bucket and namespace.

func (*Buckets) List

func (b *Buckets) List(_ context.Context, _ map[string]string) (*model.BucketList, error)

List implements the buckets API.

func (*Buckets) UpdatePolicy

func (b *Buckets) UpdatePolicy(_ context.Context, bucketName string, policy string, params map[string]string) error

UpdatePolicy implements the buckets API.

func (*Buckets) UpdateQuota

func (b *Buckets) UpdateQuota(_ context.Context, bucketQuota model.BucketQuotaUpdate) error

UpdateQuota updates the quota for the specified bucket.

type CRR

type CRR struct {
	Config *model.CRR
}

CRR implements the crr API.

func (*CRR) Get

func (c *CRR) Get(_ context.Context, destObjectScale string, destObjectStore string, _ map[string]string) (*model.CRR, error)

Get implements the CRR API.

func (*CRR) PauseReplication

func (c *CRR) PauseReplication(_ context.Context, destObjectScale string, destObjectStore string, params map[string]string) error

PauseReplication implements the CRR API.

func (*CRR) ResumeReplication

func (c *CRR) ResumeReplication(_ context.Context, destObjectScale string, destObjectStore string, _ map[string]string) error

ResumeReplication implements the CRR API.

func (*CRR) SuspendReplication

func (c *CRR) SuspendReplication(_ context.Context, destObjectScale string, destObjectStore string, _ map[string]string) error

SuspendReplication implements the CRR API.

func (*CRR) ThrottleReplication

func (c *CRR) ThrottleReplication(_ context.Context, destObjectScale string, destObjectStore string, param map[string]string) error

ThrottleReplication implements the CRR API.

func (*CRR) UnthrottleReplication

func (c *CRR) UnthrottleReplication(_ context.Context, destObjectScale string, destObjectStore string, _ map[string]string) error

UnthrottleReplication implements the CRR API.

type ClientSet

type ClientSet struct {
	// contains filtered or unexported fields
}

ClientSet is a set of clients for each API section.

func NewClientSet

func NewClientSet(objs ...interface{}) *ClientSet

NewClientSet returns a new client set based on the provided REST client parameters.

func (*ClientSet) AlertPolicies

func (c *ClientSet) AlertPolicies() api.AlertPoliciesInterface

AlertPolicies implements the client API.

func (*ClientSet) Buckets

func (c *ClientSet) Buckets() api.BucketsInterface

Buckets implements the client API.

func (*ClientSet) CRR

func (c *ClientSet) CRR() api.CRRInterface

CRR implements the client API.

func (*ClientSet) FederatedObjectStores

func (c *ClientSet) FederatedObjectStores() api.FederatedObjectStoresInterface

FederatedObjectStores implements the client API.

func (*ClientSet) ObjectMt

func (c *ClientSet) ObjectMt() api.ObjmtInterface

ObjectMt implements the client API for objMT metrics.

func (*ClientSet) ObjectUser

func (c *ClientSet) ObjectUser() api.ObjectUserInterface

ObjectUser implements the client API.

func (*ClientSet) Status

func (c *ClientSet) Status() api.StatusInterface

Status implements the client API.

func (*ClientSet) Tenants

func (c *ClientSet) Tenants() api.TenantsInterface

Tenants implements the client API.

type FederatedObjectStores

type FederatedObjectStores struct {
	// contains filtered or unexported fields
}

FederatedObjectStores implements the federated object stores API.

func (*FederatedObjectStores) List

List implements the tenants API.

type ObjectUsers

type ObjectUsers struct {
	Users    *model.ObjectUserList
	Secrets  map[string]*model.ObjectUserSecret
	InfoList map[string]*model.ObjectUserInfo
}

ObjectUsers contains information about object users to be used in fake client set.

func NewObjectUsers

func NewObjectUsers(blobUsers []model.BlobUser, userSecrets []UserSecret, userInfoList []UserInfo) *ObjectUsers

NewObjectUsers returns initialized ObjectUsers.

func (*ObjectUsers) CreateSecret

CreateSecret will create a specific secret.

func (*ObjectUsers) DeleteSecret

DeleteSecret will delete a specific secret.

func (*ObjectUsers) GetInfo

func (o *ObjectUsers) GetInfo(_ context.Context, uid string, _ map[string]string) (*model.ObjectUserInfo, error)

GetInfo returns information about object user.

func (*ObjectUsers) GetSecret

func (o *ObjectUsers) GetSecret(_ context.Context, uid string, _ map[string]string) (*model.ObjectUserSecret, error)

GetSecret returns information about object user secrets.

func (*ObjectUsers) List

List returns a list of object users.

type Objmt

type Objmt struct {
	// contains filtered or unexported fields
}

Objmt is a fake (mocked) implementation of the Objmt interface.

func (*Objmt) GetAccountBillingInfo

func (mt *Objmt) GetAccountBillingInfo(_ context.Context, _ []string, _ map[string]string) (*model.AccountBillingInfoList, error)

GetAccountBillingInfo returns billing info metrics for defined accounts.

func (*Objmt) GetAccountBillingSample

func (mt *Objmt) GetAccountBillingSample(_ context.Context, _ []string, _ map[string]string) (*model.AccountBillingSampleList, error)

GetAccountBillingSample returns billing sample (time-window) metrics for defined accounts.

func (*Objmt) GetBucketBillingInfo

func (mt *Objmt) GetBucketBillingInfo(_ context.Context, _ string, _ []string, _ map[string]string) (*model.BucketBillingInfoList, error)

GetBucketBillingInfo returns billing info metrics for defined buckets and account.

func (*Objmt) GetBucketBillingPerf

func (mt *Objmt) GetBucketBillingPerf(_ context.Context, _ string, _ []string, _ map[string]string) (*model.BucketPerfDataList, error)

GetBucketBillingPerf returns performance metrics for defined buckets and account.

func (*Objmt) GetBucketBillingSample

func (mt *Objmt) GetBucketBillingSample(_ context.Context, _ string, _ []string, _ map[string]string) (*model.BucketBillingSampleList, error)

GetBucketBillingSample returns billing sample (time-window) metrics for defined buckets and account.

func (*Objmt) GetReplicationInfo

func (mt *Objmt) GetReplicationInfo(_ context.Context, _ string, _ [][]string, _ map[string]string) (*model.BucketReplicationInfoList, error)

GetReplicationInfo returns billing info metrics for defined replication pairs and account.

func (*Objmt) GetReplicationSample

func (mt *Objmt) GetReplicationSample(_ context.Context, _ string, _ [][]string, _ map[string]string) (*model.BucketReplicationSampleList, error)

GetReplicationSample returns billing sample (time-window) metrics for defined replication pairs and account.

func (*Objmt) GetStoreBillingInfo

func (mt *Objmt) GetStoreBillingInfo(_ context.Context, _ map[string]string) (*model.StoreBillingInfoList, error)

GetStoreBillingInfo returns billing info metrics for object store.

func (*Objmt) GetStoreBillingSample

func (mt *Objmt) GetStoreBillingSample(_ context.Context, _ map[string]string) (*model.StoreBillingSampleList, error)

GetStoreBillingSample returns billing sample (time-window) metrics for object store.

func (*Objmt) GetStoreReplicationData

func (mt *Objmt) GetStoreReplicationData(_ context.Context, _ []string, _ map[string]string) (*model.StoreReplicationDataList, error)

GetStoreReplicationData returns CRR metrics for defined object stores.

type Status

type Status struct {
	RebuildInfo *model.RebuildInfo
}

Status implements the Status API.

func (*Status) GetRebuildStatus

func (s *Status) GetRebuildStatus(_ context.Context, _, _, _, _ string, _ map[string]string) (*model.RebuildInfo, error)

GetRebuildStatus implements the Status API.

type Tenants

type Tenants struct {
	// contains filtered or unexported fields
}

Tenants implements the tenants API.

func (*Tenants) Create

func (t *Tenants) Create(_ context.Context, payload model.TenantCreate) (*model.Tenant, error)

Create creates a tenant in an object store.

func (*Tenants) Delete

func (t *Tenants) Delete(_ context.Context, tenantID string) error

Delete deletes a tenant in an object store.

func (*Tenants) DeleteQuota

func (t *Tenants) DeleteQuota(_ context.Context, id string) error

DeleteQuota deletes the quota settings for the given tenant.

func (*Tenants) Get

func (t *Tenants) Get(_ context.Context, id string, _ map[string]string) (*model.Tenant, error)

Get implements the tenants API.

func (*Tenants) GetQuota

func (t *Tenants) GetQuota(_ context.Context, id string, _ map[string]string) (*model.TenantQuota, error)

GetQuota retrieves the quota settings for the given tenant.

func (*Tenants) List

func (t *Tenants) List(_ context.Context, _ map[string]string) (*model.TenantList, error)

List implements the tenants API.

func (*Tenants) SetQuota

func (t *Tenants) SetQuota(_ context.Context, id string, tenantQuota model.TenantQuotaSet) error

SetQuota updates the quota settings for the given tenant.

func (*Tenants) Update

func (t *Tenants) Update(_ context.Context, payload model.TenantUpdate, tenantID string) error

Update updates Tenant details default_bucket_size and alias.

type UserInfo

type UserInfo struct {
	UID  string
	Info *model.ObjectUserInfo
}

UserInfo make easiest passing info about users.

type UserSecret

type UserSecret struct {
	UID    string
	Secret *model.ObjectUserSecret
}

UserSecret make easiest passing secret about users.

Jump to

Keyboard shortcuts

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