object

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCert

func AddCert(cert *Cert) bool

func AddSite

func AddSite(site *Site) bool

func DeleteCert

func DeleteCert(cert *Cert) bool

func DeleteSite

func DeleteSite(site *Site) bool

func InitAdapter

func InitAdapter()

func InitConfig

func InitConfig()

func InitSiteMap

func InitSiteMap()

func UpdateCert

func UpdateCert(id string, cert *Cert) bool

func UpdateSite

func UpdateSite(id string, site *Site) bool

func UpdateSiteNoRefresh

func UpdateSiteNoRefresh(id string, site *Site) bool

Types

type Adapter

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

Adapter represents the MySQL adapter for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string) *Adapter

NewAdapter is the constructor for Adapter.

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"`

	Certificate string `xorm:"mediumtext" json:"certificate"`
	PrivateKey  string `xorm:"mediumtext" json:"privateKey"`
}

func GetCert

func GetCert(id string) *Cert

func GetCerts

func GetCerts(owner string) []*Cert

func GetGlobalCerts

func GetGlobalCerts() []*Cert

func (*Cert) GetId

func (cert *Cert) 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"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	Domain   string `xorm:"varchar(100)" json:"domain"`
	Host     string `xorm:"varchar(100)" json:"host"`
	SslMode  string `xorm:"varchar(100)" json:"sslMode"`
	SslCert  string `xorm:"varchar(100)" json:"sslCert"`
	PublicIp string `xorm:"varchar(100)" json:"publicIp"`
	Node     string `xorm:"varchar(100)" json:"node"`
	IsSelf   bool   `json:"isSelf"`

	CasdoorApplication string `xorm:"varchar(100)" json:"casdoorApplication"`

	SslCertObj     *Cert                `xorm:"-" json:"sslCertObj"`
	ApplicationObj *casdoor.Application `xorm:"-" json:"applicationObj"`
}

func GetGlobalSites

func GetGlobalSites() []*Site

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

func GetSiteByDomain

func GetSiteByDomain(domain string) *Site

func GetSites

func GetSites(owner string) []*Site

func (*Site) GetId

func (site *Site) GetId() string

Jump to

Keyboard shortcuts

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