Documentation
¶
Index ¶
- func AddCert(cert *Cert) (bool, error)
- func AddNode(node *Node) (bool, error)
- func AddRecord(record *Record) (bool, error)
- func AddRule(rule *Rule) (bool, error)
- func AddSite(site *Site) (bool, error)
- func CreateTables()
- func DeleteCert(cert *Cert) (bool, error)
- func DeleteNode(node *Node) (bool, error)
- func DeleteRecord(record *Record) (bool, error)
- func DeleteRule(rule *Rule) (bool, error)
- func DeleteSite(site *Site) (bool, error)
- func GetAcmeClient(useProxy bool) (*lego.Client, error)
- func GetCertCount(owner, field, value string) (int64, error)
- func GetDomainExpireTime(domainName string) (string, error)
- func GetMetrics(dataType string, startAt time.Time, top int) (*[]DataCount, error)
- func GetMetricsOverTime(startAt time.Time, timeType string) (*[]DataCount, error)
- func GetNodeCount(owner, field, value string) (int64, error)
- func GetRecordCount(owner, field, value string) (int64, error)
- func GetRuleCount(owner, field, value string) (int64, error)
- func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session
- func GetSiteCount(owner, field, value string) (int64, error)
- func InitAdapter()
- func InitConfig()
- func InitFlag()
- func InitRuleMap()
- func InitSiteMap()
- func RenewCert(cert *Cert) (bool, error)
- func StartMonitorSitesLoop()
- func UpdateCert(id string, cert *Cert) (bool, error)
- func UpdateNode(id string, node *Node) (bool, error)
- func UpdateRecord(owner string, id string, record *Record) (bool, error)
- func UpdateRule(id string, rule *Rule) (bool, error)
- func UpdateSite(id string, site *Site) (bool, error)
- func UpdateSiteNoRefresh(id string, site *Site) (bool, error)
- type Account
- type Cert
- func GetCert(id string) (*Cert, error)
- func GetCertByDomain(domain string) (*Cert, error)
- func GetCerts(owner string) ([]*Cert, error)
- func GetGlobalCerts() ([]*Cert, error)
- func GetMaskedCert(cert *Cert) *Cert
- func GetMaskedCerts(certs []*Cert) []*Cert
- func GetPaginationCerts(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Cert, error)
- type DataCount
- type Expression
- type HttpProvider
- type Node
- type NodeItem
- type Ormer
- type Record
- type Rule
- type Site
- func GetGlobalSites() ([]*Site, error)
- func GetMaskedSite(site *Site, node string) *Site
- func GetMaskedSites(sites []*Site, node string) []*Site
- func GetPaginationSites(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Site, error)
- func GetSite(id string) (*Site, error)
- func GetSiteByDomain(domain string) *Site
- func GetSites(owner string) ([]*Site, error)
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶ added in v1.3.0
func CreateTables()
func DeleteCert ¶
func DeleteNode ¶ added in v1.64.0
func DeleteRecord ¶ added in v1.7.0
func DeleteRule ¶ added in v1.13.0
func DeleteSite ¶
func GetCertCount ¶ added in v1.21.0
func GetDomainExpireTime ¶ added in v1.15.0
func GetMetrics ¶ added in v1.8.0
func GetMetricsOverTime ¶ added in v1.8.0
func GetNodeCount ¶ added in v1.64.0
func GetRecordCount ¶ added in v1.27.0
func GetRuleCount ¶ added in v1.27.0
func GetSession ¶ added in v1.21.0
func GetSiteCount ¶ added in v1.21.0
func InitAdapter ¶
func InitAdapter()
func InitConfig ¶
func InitConfig()
func InitRuleMap ¶ added in v1.16.0
func InitRuleMap()
func InitSiteMap ¶
func InitSiteMap()
func StartMonitorSitesLoop ¶ added in v1.3.0
func StartMonitorSitesLoop()
func UpdateRecord ¶ added in v1.7.0
Types ¶
type Account ¶ added in v1.3.0
type Account struct {
Email string
Registration *registration.Resource
// contains filtered or unexported fields
}
func (*Account) GetPrivateKey ¶ added in v1.3.0
func (a *Account) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns the private RSA account key.
func (*Account) GetRegistration ¶ added in v1.3.0
func (a *Account) GetRegistration() *registration.Resource
GetRegistration returns the server registration.
type Cert ¶
type Cert struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Type string `xorm:"varchar(100)" json:"type"`
CryptoAlgorithm string `xorm:"varchar(100)" json:"cryptoAlgorithm"`
ExpireTime string `xorm:"varchar(100)" json:"expireTime"`
DomainExpireTime string `xorm:"varchar(100)" json:"domainExpireTime"`
Provider string `xorm:"varchar(100)" json:"provider"`
Account string `xorm:"varchar(100)" json:"account"`
AccessKey string `xorm:"varchar(100)" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
Certificate string `xorm:"mediumtext" json:"certificate"`
PrivateKey string `xorm:"mediumtext" json:"privateKey"`
}
func GetCertByDomain ¶ added in v1.3.0
func GetGlobalCerts ¶
func GetMaskedCert ¶ added in v1.3.0
func GetMaskedCerts ¶ added in v1.3.0
func GetPaginationCerts ¶ added in v1.21.0
type Expression ¶ added in v1.13.0
type HttpProvider ¶ added in v1.3.0
type HttpProvider struct {
// contains filtered or unexported fields
}
type Node ¶ added in v1.3.0
type Node struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Tag string `xorm:"varchar(100)" json:"tag"`
ClientIp string `xorm:"varchar(100)" json:"clientIp"`
UpgradeMode string `xorm:"varchar(100)" json:"upgradeMode"`
}
func GetGlobalNodes ¶ added in v1.64.0
func GetPaginationNodes ¶ added in v1.64.0
func (*Node) ShouldAllowUpgrade ¶ added in v1.65.1
ShouldAllowUpgrade checks if upgrade is allowed based on node's upgrade mode
type Ormer ¶ added in v1.3.0
Ormer represents the MySQL adapter for policy storage.
func NewAdapter ¶
NewAdapter is the constructor for Ormer.
func (*Ormer) CreateDatabase ¶ added in v1.3.0
type Record ¶ added in v1.7.0
type Record struct {
Id int64 `xorm:"int notnull pk autoincr" json:"id"`
Owner string `xorm:"varchar(100) notnull" json:"owner"`
CreatedTime string `xorm:"varchar(100) notnull" json:"createdTime"`
Method string `xorm:"varchar(100)" json:"method"`
Host string `xorm:"varchar(100)" json:"host"`
Path string `xorm:"varchar(100)" json:"path"`
ClientIp string `xorm:"varchar(100)" json:"clientIp"`
UserAgent string `xorm:"varchar(512)" json:"userAgent"`
}
func GetPaginationRecords ¶ added in v1.27.0
func GetRecords ¶ added in v1.7.0
type Rule ¶ added in v1.13.0
type Rule struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100) notnull" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100) notnull" json:"updatedTime"`
Type string `xorm:"varchar(100) notnull" json:"type"`
Expressions []*Expression `xorm:"mediumtext" json:"expressions"`
Action string `xorm:"varchar(100) notnull" json:"action"`
StatusCode int `xorm:"int notnull" json:"statusCode"`
Reason string `xorm:"varchar(100) notnull" json:"reason"`
IsVerbose bool `xorm:"bool" json:"isVerbose"`
}
func GetGlobalRules ¶ added in v1.16.0
func GetPaginationRules ¶ added in v1.27.0
func GetRulesByRuleIds ¶ added in v1.16.0
type Site ¶
type Site struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Tag string `xorm:"varchar(100)" json:"tag"`
Domain string `xorm:"varchar(100)" json:"domain"`
OtherDomains []string `xorm:"varchar(500)" json:"otherDomains"`
NeedRedirect bool `json:"needRedirect"`
DisableVerbose bool `json:"disableVerbose"`
Rules []string `xorm:"varchar(500)" json:"rules"`
EnableAlert bool `json:"enableAlert"`
AlertInterval int `json:"alertInterval"`
AlertTryTimes int `json:"alertTryTimes"`
AlertProviders []string `xorm:"varchar(500)" json:"alertProviders"`
Challenges []string `xorm:"mediumtext" json:"challenges"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
Hosts []string `xorm:"varchar(1000)" json:"hosts"`
SslMode string `xorm:"varchar(100)" json:"sslMode"`
SslCert string `xorm:"-" json:"sslCert"`
PublicIp string `xorm:"varchar(100)" json:"publicIp"`
Node string `xorm:"varchar(100)" json:"node"`
IsSelf bool `json:"isSelf"`
Status string `xorm:"varchar(100)" json:"status"`
Nodes []*NodeItem `xorm:"mediumtext" json:"nodes"`
CasdoorApplication string `xorm:"varchar(100)" json:"casdoorApplication"`
ApplicationObj *casdoorsdk.Application `xorm:"-" json:"applicationObj"`
}
func GetGlobalSites ¶
func GetMaskedSite ¶
func GetMaskedSites ¶
func GetPaginationSites ¶ added in v1.21.0
func GetSiteByDomain ¶
func (*Site) GetChallengeMap ¶ added in v1.3.0
type VersionInfo ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.