user

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	*db.SQLDB
	ID string
	*assets.Manager
}

func (*User) AllocateStorage

func (u *User) AllocateStorage(ctx context.Context, size int64) (*types.UserInfo, error)

AllocateStorage allocates storage space.

func (*User) CreateAPIKey

func (u *User) CreateAPIKey(ctx context.Context, keyName string, perms []types.UserAccessControl, schedulerCfg *config.SchedulerCfg, commonAPI api.Common) (string, error)

CreateAPIKey creates a key for the client API.

func (*User) CreateAsset

func (u *User) CreateAsset(ctx context.Context, req *types.CreateAssetReq) (*types.CreateAssetRsp, error)

CreateAsset creates an asset with car CID, car name, and car size.

func (*User) DeleteAPIKey

func (u *User) DeleteAPIKey(ctx context.Context, name string) error

func (*User) DeleteAsset

func (u *User) DeleteAsset(ctx context.Context, cid string) error

DeleteAsset deletes the assets of the user.

func (*User) GetAPIKeys

func (u *User) GetAPIKeys(ctx context.Context) (map[string]types.UserAPIKeysInfo, error)

GetAPIKeys get all api key for user.

func (*User) GetAssetStatus added in v0.1.11

func (u *User) GetAssetStatus(ctx context.Context, assetCID string, config *config.SchedulerCfg) (*types.AssetStatus, error)

GetAssetStatus retrieves a asset status

func (*User) GetInfo added in v0.1.11

func (u *User) GetInfo() (*types.UserInfo, error)

GetInfo get user info

func (*User) ListAssets

func (u *User) ListAssets(ctx context.Context, limit, offset, maxCountOfVisitAsset, groupID int) (*types.ListAssetRecordRsp, error)

ListAssets lists the assets of the user.

func (*User) SetAssetAtShareStatus added in v0.1.11

func (u *User) SetAssetAtShareStatus(ctx context.Context, assetCID string) error

UpdateShareStatus update status

func (*User) ShareAssets

func (u *User) ShareAssets(ctx context.Context, assetCIDs []string, schedulerAPI api.Scheduler, nodeManager *node.Manager) (map[string]string, error)

ShareAssets shares the assets of the user.

Jump to

Keyboard shortcuts

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