Documentation ¶
Index ¶
- Constants
- func RegionDescriptionJSON(data RegionDescription) string
- func SetUserPhaseGiveAmount(annotations map[string]string, activityType string, phase string, ...) map[string]string
- type Account
- type AccountConfig
- type AccountTransaction
- type Activities
- type Activity
- type ActivityType
- type CVMBilling
- type ConfigType
- type Configs
- type CvmBillingStatus
- type CvmCloudProvider
- type GetTransfersReq
- type GetTransfersResp
- type GiftCode
- type Invoice
- type InvoicePayment
- type InvoiceStatus
- type JoinStatus
- type LimitReq
- type LimitResp
- type OauthProvider
- type OauthProviderType
- type ObjectStorageTraffic
- type Payment
- type PaymentRaw
- type Phase
- type RechargeDiscount
- type RechargeDiscountInfo
- type Region
- type RegionDescription
- type RegionUserCr
- type Role
- type Task
- type TaskStatus
- type TaskType
- type TimeRange
- type Transfer
- type TransferType
- type User
- type UserActivities
- type UserActivity
- type UserPhase
- type UserQueryOpts
- type UserRealNameInfo
- type UserRechargeDiscount
- type UserStatus
- type UserTask
- type UserWorkspace
- type Workspace
Constants ¶
View Source
const ( CVMBillingStatePending = "Pending" CVMBillingStateDone = "Done" CVMCloudProviderTencent = "tencent" )
View Source
const ( OauthProviderTypePhone OauthProviderType = "PHONE" OauthProviderTypeEmail OauthProviderType = "EMAIL" OauthProviderTypePassword OauthProviderType = "PASSWORD" RoleOwner Role = "OWNER" JoinStatusInWorkspace JoinStatus = "IN_WORKSPACE" )
View Source
const ( PendingInvoiceStatus = "PENDING" CompletedInvoiceStatus = "COMPLETED" RejectedInvoiceStatus = "REJECTED" )
Variables ¶
This section is empty.
Functions ¶
func RegionDescriptionJSON ¶
func RegionDescriptionJSON(data RegionDescription) string
Types ¶
type Account ¶
type Account struct { UserUID uuid.UUID `gorm:"column:userUid;type:uuid;default:gen_random_uuid();primary_key"` ActivityBonus int64 `gorm:"column:activityBonus;type:bigint;not null"` // Discard EncryptBalance and EncryptDeductionBalance EncryptBalance string `gorm:"column:encryptBalance;type:text;not null"` EncryptDeductionBalance string `gorm:"column:encryptDeductionBalance;type:text;not null"` CreatedAt time.Time `gorm:"type:timestamp(3) with time zone;default:current_timestamp()"` CreateRegionID string `gorm:"type:text;not null"` Balance int64 DeductionBalance int64 }
type AccountConfig ¶
type AccountTransaction ¶
type AccountTransaction struct { ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid();primary_key"` Type string `gorm:"column:type;type:text"` UserUID uuid.UUID `gorm:"column:userUid;type:uuid"` DeductionBalance int64 `gorm:"column:deduction_balance;type:bigint"` Balance int64 `gorm:"column:balance;type:bigint"` Message *string `gorm:"column:message;type:text"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp(3) with time zone;default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp(3) with time zone;default:current_timestamp()"` BillingID uuid.UUID `gorm:"column:billing_id;type:uuid"` }
func (AccountTransaction) TableName ¶
func (AccountTransaction) TableName() string
type Activities ¶
type Activity ¶
type Activity struct { gorm.Model ActivityType string `gorm:"uniqueIndex"` PhaseOrder string Phases []Phase }
TODO the following structures will be deleted
type ActivityType ¶
type ActivityType string
const (
ActivityTypeFirstRecharge ActivityType = "FIRST_RECHARGE"
)
type CVMBilling ¶
type CVMBilling struct { ID primitive.ObjectID `json:"_id" bson:"_id"` InstanceName string `json:"instanceName"` //Namespace string `json:"namespace"` //VirtualMachinePackageId string `json:"virtualMachinePackageId"` StartAt time.Time `json:"startAt"` EndAt time.Time `json:"endAt"` //CloudProvider CvmCloudProvider `json:"cloudProvider"` //SealosUserID string `json:"sealosUserId"` SealosUserUID string `json:"sealosUserUid"` SealosRegionUID string `json:"sealosRegionUid"` SealosRegionDomain string `json:"sealosRegionDomain"` Amount float64 `json:"amount"` Detail struct { Instance float64 `json:"instance"` Network float64 `json:"network"` Disk float64 `json:"disk"` } State CvmBillingStatus `json:"state"` }
CVMBilling represents the billing information of a CloudVirtualMachine instance
type Configs ¶
type Configs struct { Type ConfigType `json:"type" gorm:"type:varchar(255);not null,primaryKey"` Data string `json:"data" gorm:"type:jsonb"` }
type CvmBillingStatus ¶
type CvmBillingStatus string
type CvmCloudProvider ¶
type CvmCloudProvider string
type GetTransfersReq ¶
type GetTransfersReq struct { *UserQueryOpts // can be empty to get all transfers TransferID string `json:"transferID"` // 0: all, 1: in, 2: out Type TransferType `json:"type"` LimitReq `json:",inline"` }
type GetTransfersResp ¶
type GiftCode ¶
type GiftCode struct { ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid();primary_key"` Code string `gorm:"column:code;type:text;not null;unique"` CreditAmount int64 `gorm:"column:creditAmount;type:bigint;default:0;not null"` Used bool `gorm:"column:used;type:boolean;default:false;not null"` UsedBy uuid.UUID `gorm:"column:usedBy;type:uuid"` UsedAt time.Time `gorm:"column:usedAt;type:timestamp(3) with time zone"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp()"` ExpiredAt time.Time `gorm:"column:expiredAt;type:timestamp(3) with time zone"` Comment string `gorm:"column:comment;type:text"` }
type Invoice ¶
type Invoice struct { ID string `gorm:"type:text;primary_key" json:"id" bson:"id"` UserID string `gorm:"type:text;not null" json:"userID" bson:"userID"` CreatedAt time.Time `gorm:"type:timestamp(3) with time zone;default:current_timestamp()" bson:"createdAt" json:"createdAt"` UpdatedAt time.Time `gorm:"type:timestamp(3) with time zone;default:current_timestamp()" bson:"updatedAt" json:"updatedAt"` Detail string `gorm:"type:text;not null" json:"detail" bson:"detail"` Remark string `gorm:"type:text" json:"remark" bson:"remark"` TotalAmount int64 `gorm:"type:bigint;not null" json:"totalAmount" bson:"totalAmount"` // Pending, Completed, Rejected Status InvoiceStatus `gorm:"type:text;not null" json:"status" bson:"status"` }
type InvoicePayment ¶
type InvoicePayment struct { InvoiceID string `gorm:"type:text"` PaymentID string `gorm:"type:text;primary_key"` Amount int64 `gorm:"type:bigint;not null"` }
func (InvoicePayment) TableName ¶
func (InvoicePayment) TableName() string
type InvoiceStatus ¶
type InvoiceStatus string
type JoinStatus ¶
type JoinStatus string
type OauthProvider ¶
type OauthProvider struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` UserUID uuid.UUID `gorm:"column:userUid;type:uuid;not null"` ProviderType OauthProviderType `gorm:"column:providerType;type:text;not null"` ProviderID string `gorm:"column:providerId;type:text;not null"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3);default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3);default:current_timestamp()"` Password string `gorm:"type:text"` }
func (OauthProvider) TableName ¶
func (OauthProvider) TableName() string
type OauthProviderType ¶
type OauthProviderType string
type ObjectStorageTraffic ¶
type Payment ¶
type Payment struct { ID string `gorm:"type:text;primary_key"` PaymentRaw }
type PaymentRaw ¶
type PaymentRaw struct { UserUID uuid.UUID `gorm:"column:userUid;type:uuid;not null"` RegionUID uuid.UUID `gorm:"column:regionUid;type:uuid;not null"` CreatedAt time.Time `gorm:"type:timestamp(3) with time zone;default:current_timestamp()"` RegionUserOwner string `gorm:"column:regionUserOwner;type:text;not null"` Method string `gorm:"type:text;not null"` Amount int64 `gorm:"type:bigint;not null"` Gift int64 `gorm:"type:bigint"` TradeNO string `gorm:"type:text;unique;not null"` // CodeURL is the codeURL of wechatpay CodeURL string `gorm:"type:text"` InvoicedAt bool `gorm:"type:boolean;default:false"` Remark string `gorm:"type:text"` ActivityType ActivityType `gorm:"type:text;column:activityType"` Message string `gorm:"type:text;not null"` }
type RechargeDiscount ¶
type RechargeDiscountInfo ¶
type RechargeDiscountInfo struct { LimitTimes int64 `gorm:"default:0"` LimitDuration string RechargeDiscount }
type Region ¶
type Region struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` DisplayName string `gorm:"column:displayName;type:text"` Location string `gorm:"column:location;type:text"` Domain string `gorm:"column:domain;type:text;not null;unique"` Description string `gorm:"column:description;type:text"` }
type RegionDescription ¶
type RegionUserCr ¶
type RegionUserCr struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` CrName string `gorm:"type:text;column:crName;not null;unique"` UserUID uuid.UUID `gorm:"column:userUid;type:uuid;not null"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3);default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3);default:current_timestamp()"` }
RegionUserCr is located in the region
func (RegionUserCr) TableName ¶
func (RegionUserCr) TableName() string
type Task ¶
type Task struct { ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid();primary_key" json:"id"` Title string `gorm:"column:title;type:text;not null" json:"title"` Description string `gorm:"column:description;type:text;not null" json:"description"` Reward int64 `gorm:"column:reward;type:bigint;not null" json:"reward"` Order int `gorm:"column:order;type:integer;not null" json:"order"` IsActive bool `gorm:"column:isActive;type:boolean;default:true;not null" json:"isActive"` IsNewUserTask bool `gorm:"column:isNewUserTask;type:boolean;default:false;not null" json:"isNewUserTask"` TaskType TaskType `gorm:"column:taskType;type:TaskType;not null" json:"taskType"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp();not null" json:"createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;not null" json:"updatedAt"` }
Task represents the Task model in Go with GORM annotations.
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the TaskStatus enum in Go.
const ( TaskStatusNotCompleted TaskStatus = "NOT_COMPLETED" TaskStatusCompleted TaskStatus = "COMPLETED" )
type Transfer ¶
type Transfer struct { ID string `gorm:"type:text;primary_key"` UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` FromUserUID uuid.UUID `gorm:"column:fromUserUid;type:uuid;not null"` FromUserID string `gorm:"column:fromUserId;type:text;not null"` ToUserUID uuid.UUID `gorm:"column:toUserUid;type:uuid;not null"` ToUserID string `gorm:"column:toUserId;type:text;not null"` Amount int64 `gorm:"type:bigint;not null"` Remark string `gorm:"type:text;not null"` CreatedAt time.Time `gorm:"type:timestamp(3) with time zone;default:current_timestamp()"` }
type TransferType ¶
type TransferType int
const ( TypeTransferAll TransferType = iota TypeTransferIn TypeTransferOut )
type User ¶
type User struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;default:current_timestamp()"` AvatarURI string `gorm:"column:avatarUri;type:text"` Nickname string `gorm:"type:text"` ID string `gorm:"type:text;not null;unique"` Name string `gorm:"type:text;not null"` Status UserStatus `gorm:"column:status;type:UserStatus;default:'NORMAL_USER'::defaultdb.public.'UserStatus';not null"` }
type UserActivities ¶
type UserActivities map[string]*UserActivity
type UserActivity ¶
type UserQueryOpts ¶
type UserRealNameInfo ¶
type UserRealNameInfo struct { ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid();primary_key"` UserUID uuid.UUID `gorm:"column:userUid;type:uuid;unique"` RealName *string `gorm:"column:realName;type:text"` IDCard *string `gorm:"column:idCard;type:text"` Phone *string `gorm:"column:phone;type:text"` IsVerified bool `gorm:"column:isVerified;type:boolean;default:false"` IDVerifyFailedTimes int `gorm:"column:idVerifyFailedTimes;type:integer;default:0"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;autoUpdateTime"` AdditionalInfo json.RawMessage `gorm:"column:additionalInfo;type:jsonb"` }
func (UserRealNameInfo) TableName ¶
func (UserRealNameInfo) TableName() string
type UserRechargeDiscount ¶
type UserStatus ¶
type UserStatus string
const ( UserStatusNormal UserStatus = "NORMAL_USER" UserStatusLock UserStatus = "LOCK_USER" )
type UserTask ¶
type UserTask struct { ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid();primary_key" json:"id"` UserUID uuid.UUID `gorm:"column:userUid;type:uuid;not null" json:"userUid"` TaskID uuid.UUID `gorm:"column:taskId;type:uuid;not null" json:"taskId"` Status TaskStatus `gorm:"column:status;type:TaskStatus;not null" json:"status"` RewardStatus TaskStatus `gorm:"column:rewardStatus;type:TaskStatus;not null" json:"rewardStatus"` CompletedAt time.Time `gorm:"column:completedAt;type:timestamp(3);not null" json:"completedAt"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp();not null" json:"createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;not null" json:"updatedAt"` }
UserTask represents the UserTask model in Go with GORM annotations.
type UserWorkspace ¶
type UserWorkspace struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;default:current_timestamp()"` WorkspaceUID uuid.UUID `gorm:"column:workspaceUid;type:uuid;not null"` UserCrUID uuid.UUID `gorm:"column:userCrUid;type:uuid;not null"` HandlerUID uuid.UUID `gorm:"column:handlerUid;type:uuid"` Role Role `gorm:"type:Role;default:'DEVELOPER'::defaultdb.public.'Role';not null"` Status JoinStatus IsPrivate bool `gorm:"column:isPrivate;type:boolean;not null"` JoinAt time.Time `gorm:"column:joinAt;type:timestamp(3) with time zone"` }
func (UserWorkspace) TableName ¶
func (UserWorkspace) TableName() string
type Workspace ¶
type Workspace struct { UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primary_key"` ID string `gorm:"type:text;not null;unique"` DisplayName string `gorm:"column:displayName;type:text;not null"` CreatedAt time.Time `gorm:"column:createdAt;type:timestamp(3) with time zone;default:current_timestamp()"` UpdatedAt time.Time `gorm:"column:updatedAt;type:timestamp(3) with time zone;default:current_timestamp()"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.