object

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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 GetWAFRules added in v1.13.0

func GetWAFRules() string

func InitAdapter

func InitAdapter()

func InitConfig

func InitConfig()

func InitFlag added in v1.3.0

func InitFlag()

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 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 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 (*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 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"`
	Type        string       `xorm:"varchar(100) notnull" json:"type"`
	Expressions []Expression `xorm:"mediumtext" json:"expressions"`
	CreatedTime string       `xorm:"varchar(100) notnull" json:"createdTime"`
	UpdatedTime string       `xorm:"varchar(100) notnull" json:"updatedTime"`
}

func GetRule added in v1.13.0

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

func GetRules added in v1.13.0

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

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"`
	EnableWaf    bool       `json:"enableWaf"`
	Waf          coraza.WAF `xorm:"-" json:"-"`
	Challenges   []string   `xorm:"mediumtext" json:"challenges"`
	Host         string     `xorm:"varchar(100)" json:"host"`
	Port         int        `json:"port"`
	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 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