public

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prompt *[]config.Prompt

Functions

func FirstCheck

func FirstCheck(userid string) bool

func GetBalance

func GetBalance() (string, error)

GetBalance 获取账号余额

func GetReadTime

func GetReadTime(t time.Time) string

func InitAiCli

func InitAiCli() *resty.Client

func InitSvc

func InitSvc()

func JudgeAdminUsers

func JudgeAdminUsers(s string) bool

JudgeAdminUsers 判断用户是否为系统管理员

func JudgeSensitiveWord

func JudgeSensitiveWord(s string) bool

JudgeSensitiveWord 判断内容是否包含敏感词

func JudgeUsers

func JudgeUsers(s string) bool

JudgeUsers 判断用户是否在白名单

func JudgeVipUsers

func JudgeVipUsers(s string) bool

JudgeVipUsers 判断用户是否为VIP用户

func SolveSensitiveWord

func SolveSensitiveWord(s string) string

SolveSensitiveWord 将敏感词用 🚫 占位

func WriteToFile

func WriteToFile(path string, data []byte) error

将内容写入到文件,如果文件名带路径,则会判断路径是否存在,不存在则创建

Types

type Bill

type Bill struct {
	Object     string      `json:"object"`
	DailyCosts []DailyCost `json:"daily_costs"`
	TotalUsage float64     `json:"total_usage"`
}

type DailyCost

type DailyCost struct {
	Timestamp float64    `json:"timestamp"`
	LineItems []LineItem `json:"line_items"`
}

type LineItem

type LineItem struct {
	Name string  `json:"name"`
	Cost float64 `json:"cost"`
}

type Plan

type Plan struct {
	Title string `json:"title"`
	ID    string `json:"id"`
}

type Subscription

type Subscription struct {
	Object             string      `json:"object"`
	HasPaymentMethod   bool        `json:"has_payment_method"`
	Canceled           bool        `json:"canceled"`
	CanceledAt         interface{} `json:"canceled_at"`
	Delinquent         interface{} `json:"delinquent"`
	AccessUntil        int64       `json:"access_until"`
	SoftLimit          int64       `json:"soft_limit"`
	HardLimit          int64       `json:"hard_limit"`
	SystemHardLimit    int64       `json:"system_hard_limit"`
	SoftLimitUsd       float64     `json:"soft_limit_usd"`
	HardLimitUsd       float64     `json:"hard_limit_usd"`
	SystemHardLimitUsd float64     `json:"system_hard_limit_usd"`
	Plan               Plan        `json:"plan"`
	AccountName        string      `json:"account_name"`
	PoNumber           interface{} `json:"po_number"`
	BillingEmail       interface{} `json:"billing_email"`
	TaxIDS             interface{} `json:"tax_ids"`
	BillingAddress     interface{} `json:"billing_address"`
	BusinessAddress    interface{} `json:"business_address"`
}

func GetSub

func GetSub() (Subscription, error)

Jump to

Keyboard shortcuts

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