lib

package
v0.0.0-...-ab9dd37 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFuncMaps

func AddFuncMaps()

AddFuncMaps .

func Authenticate

func Authenticate(login string, password string, authType string) (*models.User, error)

func BurnCertificate

func BurnCertificate(CN string, serial string, tfaname string) error

func ConfSaveToFile

func ConfSaveToFile(destPath string, text string) error

ConfSaveToFile saves the given text to the specified file path, replacing Windows-style line endings with Unix-style line endings.

func CreateCertificate

func CreateCertificate(name string, staticip string, passphrase string, expiredays string, email string, country string, province string, city string, org string, orgunit string, tfaname string, tfaissuer string) error

func CreateValidationMap

func CreateValidationMap(valid validation.Validation) map[string]map[string]string

CreateValidationMap ranslates validation structure to map that can be easly presented in template

func DeletePKI

func DeletePKI(name string) error

func Dump

func Dump(obj interface{})

Dump any structure as json string

func InitPKI

func InitPKI(name string) error

func RenewCertificate

func RenewCertificate(name string, localip string, serial string, tfaname string) error

func Restart

func Restart() error

func RestartContainer

func RestartContainer(name string) error

func RevokeCertificate

func RevokeCertificate(name string, serial string, tfaname string) error

Types

type Cert

type Cert struct {
	EntryType   string
	Expiration  string
	ExpirationT time.Time
	IsExpiring  bool
	Revocation  string
	RevocationT time.Time
	Serial      string
	FileName    string
	Details     *Details
}

Cert https://groups.google.com/d/msg/mailing.openssl.users/gMRbePiuwV0/wTASgPhuPzkJ

func ReadCerts

func ReadCerts(path string) ([]*Cert, error)

type Details

type Details struct {
	Name             string
	CN               string
	Country          string
	State            string
	City             string
	Organisation     string
	OrganisationUnit string
	Email            string
	LocalIP          string
	TFAName          string
}

type SystemInfo

type SystemInfo struct {
	Memory      sigar.Mem
	Swap        sigar.Swap
	Uptime      int
	UptimeS     string
	LoadAvg     sigar.LoadAverage
	CPUList     sigar.CpuList
	Arch        string
	Os          string
	CurrentTime time.Time
}

SystemInfo contains basic information about system load

func GetSystemInfo

func GetSystemInfo() SystemInfo

GetSystemInfo returns short info about system load

Jump to

Keyboard shortcuts

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