crud

package
v0.0.0-...-2f77c0e Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CanWriteDB = true

Functions

func BinDec

func BinDec(b string) (int, error)

binary to Decimal 1010 -> 10

func ClientUpdateOrInsert

func ClientUpdateOrInsert(ins []*AzureClient)

update or insert

func DecBin

func DecBin(n int) string

Decimal to binary 10 -> 1010

func GetDefault

func GetDefault() *gorm.DB

func GetSecretsHash

func GetSecretsHash() (string, error)

Get - one line

func Inserts

func Inserts(ins []*AzureClient)

create

func KubeconfigDelete

func KubeconfigDelete(ins []*AzureClient)

delete list

func KubeconfigDeleteOne

func KubeconfigDeleteOne(sID string) error

delete one

func KubeconfigGetCount

func KubeconfigGetCount() int

count(*)

func UpdateAzureClient

func UpdateAzureClient(in *AzureClient) error

update 单列

Types

type AzureClient

type AzureClient struct {
	gorm.Model
	SubsName       string
	SubscriptionID string
	TenantID       string
	ClientID       string
	ClientSecret   string
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      time.Time
}

func DiffClientSecrets

func DiffClientSecrets(oldData []*AzureClient, newData []*AzureClient) []*AzureClient

对比最新的数据newData,找出oldData里已经过期的数据

func GetRegisterClusters

func GetRegisterClusters() ([]*AzureClient, error)

Get - All

func (*AzureClient) TableName

func (t *AzureClient) TableName() string

type BoolConfig

type BoolConfig struct {
	IsAddName    bool //1
	IsAddAddress bool //2
	IsAddEamil   bool //3
	IsAddAge     bool //4
	IsAddPwd     bool //5
}

a lot of bool fields

func (*BoolConfig) FromBin

func (c *BoolConfig) FromBin(ins string) error

func (*BoolConfig) ToBin

func (c *BoolConfig) ToBin() string

ToBin return binary like "01000"

type ResGroupNameCost

type ResGroupNameCost struct {
	ResGroupName string
	Cost         float64
}

get 自定义select

func GetDailyResGroupCost

func GetDailyResGroupCost(in *AzureClient) []*ResGroupNameCost

func (*ResGroupNameCost) TableName

func (t *ResGroupNameCost) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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