Documentation ¶
Overview ¶
Package utils implements utility methods
Index ¶
- func CheckUserNoBalance(client *mongo.Client, billMap map[string]float64) error
- func CreateUserWithBalance(client *mongo.Client, userID string, balance float64, callbackURL string) error
- func DeleteUser(client *mongo.Client, userID string) error
- func GetComputeunitGroupList(client *mongo.Client) ([]string, error)
- func GetComputeunitInGroupByID(client *mongo.Client, groupName string, computeunitID string) (map[string]interface{}, bool, error)
- func GetComputeunitInfoByGroup(client *mongo.Client, groupName string) ([]map[string]interface{}, bool, error)
- func GetKubernetesClient() (*kubernetes.Clientset, error)
- func GetPodList(client *kubernetes.Clientset, labelSelector string, ns string) (*[]v1.Pod, error)
- func GetPriceMap(client *mongo.Client) (map[string]float64, error)
- func GetUserBalance(client *mongo.Client, userID string) (float64, error)
- func GetUserComputeunitGroup(client *mongo.Client, userID string) ([]string, error)
- func In(haystack interface{}, needle interface{}) (bool, error)
- func InitColl(client *mongo.Client) error
- func ModifyUserBalance(client *mongo.Client, userID string, balance float64) error
- func ModifyUserComputeunitGroup(client *mongo.Client, userID string, groups []string) error
- func UpdateOrInsertPod(client *mongo.Client, pod PodInfo) error
- func UpdateUserAccount(client *mongo.Client, userID string, balance *float64, callbackURL *string, ...) error
- type AccountInfo
- type ComputeunitGroup
- type ComputeunitInfo
- type InstanceInfo
- type PodInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUserNoBalance ¶
func CreateUserWithBalance ¶
func GetKubernetesClient ¶
func GetKubernetesClient() (*kubernetes.Clientset, error)
func GetPodList ¶
func GetUserComputeunitGroup ¶
func ModifyUserBalance ¶
Types ¶
type AccountInfo ¶
type AccountInfo struct { UserID string `bson:"userId,omitempty"` Balance *float64 `bson:"balance,omitempty"` CallbackURL string `bson:"callbackUrl,omitempty"` ComputeunitGroup []string `bson:"computeunitGroup,omitempty"` }
func GetAccountList ¶
func GetAccountList(client *mongo.Client) ([]AccountInfo, error)
type ComputeunitGroup ¶
type ComputeunitInfo ¶
type InstanceInfo ¶
type PodInfo ¶
type PodInfo struct { UserID string `bson:"userId,omitempty"` PodName string `bson:"podName,omitempty"` PodUID types.UID `bson:"podUID,omitempty"` InstanceID string `bson:"instanceId,omitempty"` ComputeunitList []string `bson:"computeunitList,omitempty"` StartTime time.Time `bson:"startTime,omitempty"` UpdateTime time.Time `bson:"updateTime,omitempty"` Count int64 `bson:"count,omitempty"` }
Click to show internal directories.
Click to hide internal directories.