-
Notifications
You must be signed in to change notification settings - Fork 5
/
uesr.go
44 lines (37 loc) · 1.46 KB
/
uesr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package iam
import (
"github.com/filedag-project/filedag-storage/objectservice/pkg/auth"
"github.com/filedag-project/filedag-storage/objectservice/store"
)
// AccountStatus - account status.
type AccountStatus string
// Account status per user.
const (
AccountEnabled AccountStatus = "on"
AccountDisabled AccountStatus = "off"
)
// UserInfo carries information about long term users.
type UserInfo struct {
AccountName string `json:"account_name"`
TotalStorageCapacity uint64 `json:"total_storage_capacity"`
BucketInfos []store.BucketInfo `json:"bucket_infos"`
UseStorageCapacity uint64 `json:"use_storage_capacity"`
PolicyName []string `json:"policy_name"`
Status AccountStatus `json:"status"`
}
// UserInfo carries information about long term users.
type UserOverView struct {
AccountName string `json:"account_name"`
TotalStorageCapacity uint64 `json:"total_storage_capacity"`
UseStorageCapacity uint64 `json:"use_storage_capacity"`
BucketsCount uint64 `json:"buckets_count"`
ObjectsCount uint64 `json:"objects_count"`
}
// UserIdentity represents a user's secret key and their status
type UserIdentity struct {
Credentials auth.Credentials `json:"credentials"`
TotalStorageCapacity uint64 `json:"total_storage_capacity"`
}
func newUserIdentity(cred auth.Credentials) UserIdentity {
return UserIdentity{Credentials: cred}
}