project

package
v0.0.0-...-3393155 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STARTER   = "Starter"
	PRO       = "Pro"
	ELITE     = "Elite"
	PAYPERUSE = "PayPerUse"
)

Variables

This section is empty.

Functions

func GetKubeConfig

func GetKubeConfig(token string) (string, error)

func GetNamespaceByAnnotation

func GetNamespaceByAnnotation(annotations []string) (string, string, error)

func GetUserByUsername

func GetUserByUsername(username string) (string, []string, error)

func Login

func Login(username string, password string) (string, string, string, error)

func Register

func Register(username, email string) error

func ResetPassword

func ResetPassword(userId, email, newPassword string) error

Types

type Admin

type Admin struct {
	UUID         string `json:"uuid"`
	Email        string `json:"email"`
	Phone_number string `json:"phone_number"`
}

type CheckPaymeePaymentResponse

type CheckPaymeePaymentResponse struct {
	Status  bool   `json:"status"`
	Message string `json:"message"`
	Code    int64  `json:"code"`
	Data    struct {
		PaymentStatus bool    `json:"payment_status"`
		Token         string  `json:"token"`
		Amount        float64 `json:"amount"`
		TransactionId int64   `json:"transaction_id"`
		BuyerId       int64   `json:"buyer_id"`
	}
}

type Company

type Company struct {
	IsCompany bool   `json:"isCompany"`
	TaxId     string `json:"TaxId"`
	Name      string `json:"name"`
}

type CreateNsRespData

type CreateNsRespData struct {
	Error  string `json:"error"`
	NsName string `json:"ns_name"`
}

type Data

type Data struct {
	Id           string   `json:"id"`
	PrincipalIds []string `json:"principalIds"`
}

type FindUserData

type FindUserData struct {
	Data []Data `json:"data"`
}

type Kubeconfig

type Kubeconfig struct {
	BaseType string `json:"baseType"`
	Config   string `json:"config"`
	Type     string `json:"type"`
}

type Limit

type Limit struct {
	ConfigMaps             int
	LimitsCpu              string
	LimitsMemory           string
	PersistentVolumeClaims int
	Pods                   int
	ReplicationControllers int
	RequestsStorage        string
	Secrets                int
	Services               int
	ServicesLoadBalancers  int
	ServicesNodePorts      int
}

type MetadDataData

type MetadDataData struct {
	Annotations map[string]string `json:"annotations"`
}

type NsData

type NsData struct {
	Id       string        `json:"id"`
	Metadata MetadDataData `json:"metadata"`
}

type Project

type Project struct {
	ProjectId         string    `json:"projectId"`
	ClusterId         string    `json:"clusterId"`
	CreationTimeStamp time.Time `json:"creationTimeStamp"`
	State             string    `json:"State"`
	Plan              string    `json:"plan"`
}

type ProjectRoliBindingsData

type ProjectRoliBindingsData struct {
	Id string `json:"id"`
}

type ReqData

type ReqData struct {
	// TODO: add billing account data and validte it
	UsrProjectName   string  `json:"projectName"`
	BillingAccountId string  `json:"billingAccountId"`
	PaymentToken     string  `json:"paymentToken"`
	UserId           string  `json:"userId"`
	UUID             string  `json:"uuid"`
	Plan             string  `json:"plan"`
	GitRepoName      string  `json:"gitRepoName"`
	GitRepoBranch    string  `json:"gitRepoBranch"`
	GitRepoUrl       string  `json:"gitRepoUrl"`
	IsCompany        bool    `json:"isCompany"`
	CompanyName      string  `json:"companyName"`
	TaxId            string  `json:"taxId"`
	Phone            string  `json:"phone"`
	Email            string  `json:"email"`
	Balance          float64 `json:"balance"`
}

func (*ReqData) Validate

func (r *ReqData) Validate() error

type ReqDataAddProjectToBillingAccount

type ReqDataAddProjectToBillingAccount struct {
	BillingAccountUUID uuid.UUID `json:"billing_account_uuid"`
	ProjectId          string    `json:"project_id"`
	ClusterId          string    `json:"clusterId"`
	CreationTimeStamp  time.Time `json:"creationTimeStamp"`
	Plan               string    `json:"plan"`
	State              string    `json:"state"`
}

type ReqDataCreateBillingAccount

type ReqDataCreateBillingAccount struct {
	BillingAdmins []Admin   `json:"billingAdmins"`
	Company       Company   `json:"company"`
	Projects      []Project `json:"projects"`
	Balance       float64   `json:"balance"`
}

type ReqDataKubeconfig

type ReqDataKubeconfig struct {
	Token string `json:"token"`
}

type ReqDataLogin

type ReqDataLogin struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*ReqDataLogin) Validate

func (r *ReqDataLogin) Validate() error

type ReqDataNewUser

type ReqDataNewUser struct {
	UsrProjectName string `json:"projectName"`
	Username       string `json:"username"`
	Plan           string `json:"plan"`
	GitRepoName    string `json:"gitRepoName"`
	GitRepoBranch  string `json:"gitRepoBranch"`
	GitRepoUrl     string `json:"gitRepoUrl"`
}

func (*ReqDataNewUser) Validate

func (r *ReqDataNewUser) Validate() error

type ReqDataRegister

type ReqDataRegister struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

type ReqDataResetPassword

type ReqDataResetPassword struct {
	UserId      string `json:"userId"`
	Email       string `json:"email"`
	NewPassword string `json:"newPassword"`
}

func (*ReqDataResetPassword) Validate

func (r *ReqDataResetPassword) Validate() error

type RespData

type RespData struct {
	ProjectId string `json:"id"`
	Created   string `json:"created"`
	CreatedTS int64  `json:"createdTS"`
	UUID      string `json:"uuid"`
}

type RespDataCreateBillingAccount

type RespDataCreateBillingAccount struct {
	Id string `json:"uuid"`
}

type RespDataCreateGitRepo

type RespDataCreateGitRepo struct {
	Id string `json:"id"`
}

type RespDataCreateUser

type RespDataCreateUser struct {
	Id           string   `json:"id"`
	PrincipalIds []string `json:"principalIds"`
	UUID         string   `json:"uuid"`
}

type RespDataLogin

type RespDataLogin struct {
	AuthProvider string `json:"authProvider"`
	Token        string `json:"token"`
	Name         string `json:"name"`
	Id           string `json:"userId"`
	UUID         string `json:"uuid"`
}

type RespDataNs

type RespDataNs struct {
	Data []NsData `json:"data"`
}

type RespDataProjectsByUser

type RespDataProjectsByUser struct {
	Data []ProjectRoliBindingsData `json:"data"`
}

type RespDataProvisionProject

type RespDataProvisionProject struct {
	ProjectId string `json:"projectId"`
}

func ProvisionProject

func ProvisionProject(req ReqData) (data RespDataProvisionProject, err error)

type RespDataProvisionProjectNewUser

type RespDataProvisionProjectNewUser struct {
	ProjectId string `json:"projectId"`
	Token     string `json:"token"`
	Password  string `json:"password"`
}

type RespDataRoleBinding

type RespDataRoleBinding struct {
	RoleTemplateId string `json:"roleTemplateId"`
	Name           string `json:"name"`
	Type           string `json:"type"`
	Code           string `json:"code"`
}

func AddUserToProject

func AddUserToProject(userId string, projectId string) (RespDataRoleBinding, error)

type RespDataUser

type RespDataUser struct {
	Namespace    string   `json:"namespace"`
	Id           string   `json:"id"`
	Token        string   `json:"token"`
	PrincipalIds []string `json:"principalIds"`
	ProjectId    string   `json:"projectId"`
}

type RespDataUserByUserId

type RespDataUserByUserId struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	Id       string `json:"id"`
	Type     string `json:"type"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

type UserData

type UserData struct {
	Data []RespDataUser `json:"data"`
}

Jump to

Keyboard shortcuts

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