object

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAction added in v1.36.0

func AddAction(action *Action) (bool, error)

func AddCert

func AddCert(cert *Cert) (bool, error)

func AddRecord added in v1.7.0

func AddRecord(record *Record) (bool, error)

func AddRule added in v1.13.0

func AddRule(rule *Rule) (bool, error)

func AddSite

func AddSite(site *Site) (bool, error)

func CreateTables added in v1.3.0

func CreateTables()

func DeleteAction added in v1.36.0

func DeleteAction(action *Action) (bool, error)

func DeleteCert

func DeleteCert(cert *Cert) (bool, error)

func DeleteRecord added in v1.7.0

func DeleteRecord(record *Record) (bool, error)

func DeleteRule added in v1.13.0

func DeleteRule(rule *Rule) (bool, error)

func DeleteSite

func DeleteSite(site *Site) (bool, error)

func GetAcmeClient added in v1.3.0

func GetAcmeClient(useProxy bool) (*lego.Client, error)

func GetCertCount added in v1.21.0

func GetCertCount(owner, field, value string) (int64, error)

func GetDomainExpireTime added in v1.15.0

func GetDomainExpireTime(domainName string) (string, error)

func GetMetrics added in v1.8.0

func GetMetrics(dataType string, startAt time.Time, top int) (*[]DataCount, error)

func GetMetricsOverTime added in v1.8.0

func GetMetricsOverTime(startAt time.Time, timeType string) (*[]DataCount, error)

func GetRecordCount added in v1.27.0

func GetRecordCount(owner, field, value string) (int64, error)

func GetRuleCount added in v1.27.0

func GetRuleCount(owner, field, value string) (int64, error)

func GetSession added in v1.21.0

func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session

func GetSiteCount added in v1.21.0

func GetSiteCount(owner, field, value string) (int64, error)

func InitActionMap added in v1.36.0

func InitActionMap()

func InitAdapter

func InitAdapter()

func InitConfig

func InitConfig()

func InitFlag added in v1.3.0

func InitFlag()

func InitRuleMap added in v1.16.0

func InitRuleMap()

func InitSiteMap

func InitSiteMap()

func RenewCert added in v1.3.0

func RenewCert(cert *Cert) (bool, error)

func StartMonitorSitesLoop added in v1.3.0

func StartMonitorSitesLoop()

func UpdateAction added in v1.36.0

func UpdateAction(id string, action *Action) (bool, error)

func UpdateCert

func UpdateCert(id string, cert *Cert) (bool, error)

func UpdateRecord added in v1.7.0

func UpdateRecord(owner string, id string, record *Record) (bool, error)

func UpdateRule added in v1.13.0

func UpdateRule(id string, rule *Rule) (bool, error)

func UpdateSite

func UpdateSite(id string, site *Site) (bool, error)

func UpdateSiteNoRefresh

func UpdateSiteNoRefresh(id string, site *Site) (bool, error)

Types

type Account added in v1.3.0

type Account struct {
	Email        string
	Registration *registration.Resource
	// contains filtered or unexported fields
}

func (*Account) GetEmail added in v1.3.0

func (a *Account) GetEmail() string

GetEmail returns the email address for the account.

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 Action added in v1.36.0

type Action 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"`
	Type          string `xorm:"varchar(100) notnull" json:"type"`
	StatusCode    int    `xorm:"int notnull" json:"statusCode"`
	ImmunityTimes int    `xorm:"int notnull" json:"immunityTimes"` // minutes
}

func GetAction added in v1.36.0

func GetAction(id string) (*Action, error)

func GetActionById added in v1.37.0

func GetActionById(id string) (*Action, error)

func GetActions added in v1.36.0

func GetActions(owner string) ([]*Action, error)

func GetActionsByIds added in v1.37.0

func GetActionsByIds(ids []string) ([]*Action, error)

func GetGlobalActions added in v1.36.0

func GetGlobalActions() ([]*Action, error)

func (*Action) GetId added in v1.36.0

func (action *Action) GetId() string

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 GetCert

func GetCert(id string) (*Cert, error)

func GetCertByDomain added in v1.3.0

func GetCertByDomain(domain string) (*Cert, error)

func GetCerts

func GetCerts(owner string) ([]*Cert, error)

func GetGlobalCerts

func GetGlobalCerts() ([]*Cert, error)

func GetMaskedCert added in v1.3.0

func GetMaskedCert(cert *Cert) *Cert

func GetMaskedCerts added in v1.3.0

func GetMaskedCerts(certs []*Cert) []*Cert

func GetPaginationCerts added in v1.21.0

func GetPaginationCerts(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Cert, error)

func (*Cert) GetId

func (cert *Cert) GetId() string

type DataCount added in v1.8.0

type DataCount struct {
	Data  string `json:"data"`
	Count int64  `json:"count"`
}

type Expression added in v1.13.0

type Expression struct {
	Name     string `json:"name"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
}

type HttpProvider added in v1.3.0

type HttpProvider struct {
	// contains filtered or unexported fields
}

func (*HttpProvider) CleanUp added in v1.3.0

func (p *HttpProvider) CleanUp(domain string, token string, keyAuth string) error

func (*HttpProvider) Present added in v1.3.0

func (p *HttpProvider) Present(domain string, token string, keyAuth string) error

type Node added in v1.3.0

type Node struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Diff     string `json:"diff"`
	Pid      int    `json:"pid"`
	Status   string `json:"status"`
	Message  string `json:"message"`
	Provider string `json:"provider"`
}

type Ormer added in v1.3.0

type Ormer struct {
	Engine *xorm.Engine
	// contains filtered or unexported fields
}

Ormer represents the MySQL adapter for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string, dbName string) *Ormer

NewAdapter is the constructor for Ormer.

func (*Ormer) CreateDatabase added in v1.3.0

func (a *Ormer) CreateDatabase() error

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 GetPaginationRecords(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Record, error)

func GetRecord added in v1.7.0

func GetRecord(owner string, id string) (*Record, error)

func GetRecords added in v1.7.0

func GetRecords(owner string) ([]*Record, error)

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"`
	Reason      string        `xorm:"varchar(100) notnull" json:"reason"`
}

func GetGlobalRules added in v1.16.0

func GetGlobalRules() ([]*Rule, error)

func GetPaginationRules added in v1.27.0

func GetPaginationRules(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Rule, error)

func GetRule added in v1.13.0

func GetRule(id string) (*Rule, error)

func GetRules added in v1.13.0

func GetRules(owner string) ([]*Rule, error)

func GetRulesByRuleIds added in v1.16.0

func GetRulesByRuleIds(ids []string) ([]*Rule, error)

func (*Rule) GetId added in v1.17.0

func (rule *Rule) GetId() string

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          []*Node  `xorm:"mediumtext" json:"nodes"`

	CasdoorApplication string                  `xorm:"varchar(100)" json:"casdoorApplication"`
	ApplicationObj     *casdoorsdk.Application `xorm:"-" json:"applicationObj"`
}

func GetGlobalSites

func GetGlobalSites() ([]*Site, error)

func GetMaskedSite

func GetMaskedSite(site *Site, node string) *Site

func GetMaskedSites

func GetMaskedSites(sites []*Site, node string) []*Site

func GetPaginationSites added in v1.21.0

func GetPaginationSites(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Site, error)

func GetSite

func GetSite(id string) (*Site, error)

func GetSiteByDomain

func GetSiteByDomain(domain string) *Site

func GetSites

func GetSites(owner string) ([]*Site, error)

func (*Site) GetChallengeMap added in v1.3.0

func (site *Site) GetChallengeMap() map[string]string

func (*Site) GetHost added in v1.3.0

func (site *Site) GetHost() string

func (*Site) GetId

func (site *Site) GetId() string

type VersionInfo added in v1.3.0

type VersionInfo struct {
	Version      string `json:"version"`
	CommitId     string `json:"commitId"`
	CommitOffset int    `json:"commitOffset"`
}

Jump to

Keyboard shortcuts

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