Documentation
¶
Index ¶
- Variables
- func AddOption(cmd *cobra.Command, o *Option)
- func AddStateSubDir(subDir *StateSubDir)
- func Context() (context.Context, context.CancelFunc)
- func Crash(a ...any)
- func DbCheckAccountOwns(ctx context.Context, db *pgxpool.Pool, table string, id uint64, ...) error
- func DbCheckNotExists[T any](ctx context.Context, db *pgxpool.Pool, table string, column string, value T) error
- func DbCheckNotExistsInAccount[T any](ctx context.Context, db *pgxpool.Pool, table string, column string, value T, ...) error
- func DbSelectColumn[T any](ctx context.Context, db *pgxpool.Pool, table string, column string, id uint64) (*T, error)
- func DbUpdateColumn[T any](ctx context.Context, db *pgxpool.Pool, table string, column string, value T, ...) error
- func DbUpdateUniqueColumn[T comparable](ctx context.Context, db *pgxpool.Pool, table string, column string, value T, ...) error
- func DbUpdateUniqueColumnInAccount[T comparable](ctx context.Context, db *pgxpool.Pool, table string, column string, value T, ...) error
- func EnsureIpv6PrefixContainsAddr(prefix *net.IPNet, addr net.IP) error
- func Header(s string)
- func InitConfig(save bool)
- func InitStateDir()
- func LoadOptions()
- func Output(a any)
- func OutputAll(a any)
- func OutputStringList(a []string)
- func PromptOrValidate(value *string, prompt *promptui.Prompt) error
- func RandomIpv6Addr(from *net.IPNet) (net.IP, error)
- func RandomIpv6Prefix(from *net.IPNet, length int) (*net.IPNet, error)
- func SaveConfig()
- func SetConfigPath(path string)
- func SetHomeConfigPath(dir string)
- func SetHomeStateDir(dir string)
- func SetOutputType(t string)
- func SetStateDir(dir string)
- func SetSystemConfigPath(dir string)
- func SetSystemStateDir(dir string)
- func SetTimeout(t time.Duration)
- func TlsDecodePrivKey(privKeyPem []byte) (ed25519.PrivateKey, error)
- func TlsDecodePubKey(pubKeyPem []byte) (ed25519.PublicKey, error)
- func TlsEncodePrivKey(privKey ed25519.PrivateKey) ([]byte, error)
- func TlsEncodePubKey(pubKey ed25519.PublicKey) ([]byte, error)
- func TlsGenCert(template *x509.Certificate, pubKey ed25519.PublicKey, ...) ([]byte, error)
- func TlsGenCertUsingPrivKeyFile(template *x509.Certificate, pubKey ed25519.PublicKey, caPrivKeyPath string) ([]byte, error)
- func TlsGenKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func TlsGetGrpcPubKey(ctx context.Context) (string, error)
- func TlsReadFile(path string) ([]byte, error)
- func TlsWriteFile(data []byte, path string) error
- func ValidateEmail(email string) error
- func ValidateHostName(name string) error
- func ValidateIpv6Address(addr string) error
- func ValidateIpv6Prefix(addr string, prefixLen int) error
- func ValidateNixSystem(system string) error
- func ValidateRepoName(name string) error
- func ValidateWireguardKey(key string) error
- func Warn(a ...any)
- type Option
- type StateSubDir
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TlsName = "nf6" TlsCaTemplate = &x509.Certificate{ SerialNumber: big.NewInt(69420), Subject: pkix.Name{CommonName: TlsName}, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, DNSNames: []string{TlsName}, NotBefore: notBefore, NotAfter: notAfter, KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, IsCA: true, BasicConstraintsValid: true, } TlsCertTemplate = &x509.Certificate{ SerialNumber: big.NewInt(42069), Subject: pkix.Name{CommonName: TlsName}, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, DNSNames: []string{TlsName}, NotBefore: notBefore, NotAfter: notAfter, KeyUsage: x509.KeyUsageDigitalSignature, } )
View Source
var IsDevShell = os.Getenv("IS_DEV_SHELL") != ""
View Source
var OutputType = ""
View Source
var ShowIds = false
View Source
var TableStyle = table.StyleDefault
View Source
var ValidNixSystems = []string{"x86_64-linux", "aarch64-linux"}
Functions ¶
func AddStateSubDir ¶
func AddStateSubDir(subDir *StateSubDir)
func DbCheckAccountOwns ¶
func DbCheckNotExists ¶
func DbSelectColumn ¶
func DbUpdateColumn ¶
func DbUpdateUniqueColumn ¶
func InitConfig ¶
func InitConfig(save bool)
func InitStateDir ¶
func InitStateDir()
func LoadOptions ¶
func LoadOptions()
func OutputStringList ¶
func OutputStringList(a []string)
func SaveConfig ¶
func SaveConfig()
func SetConfigPath ¶
func SetConfigPath(path string)
func SetHomeConfigPath ¶
func SetHomeConfigPath(dir string)
func SetHomeStateDir ¶
func SetHomeStateDir(dir string)
func SetOutputType ¶
func SetOutputType(t string)
func SetStateDir ¶
func SetStateDir(dir string)
func SetSystemConfigPath ¶
func SetSystemConfigPath(dir string)
func SetSystemStateDir ¶
func SetSystemStateDir(dir string)
func SetTimeout ¶
func TlsDecodePrivKey ¶
func TlsDecodePrivKey(privKeyPem []byte) (ed25519.PrivateKey, error)
func TlsEncodePrivKey ¶
func TlsEncodePrivKey(privKey ed25519.PrivateKey) ([]byte, error)
func TlsGenCert ¶
func TlsGenCert(template *x509.Certificate, pubKey ed25519.PublicKey, caPrivKey ed25519.PrivateKey) ([]byte, error)
func TlsReadFile ¶
func TlsWriteFile ¶
func ValidateEmail ¶
func ValidateHostName ¶
func ValidateIpv6Address ¶
func ValidateIpv6Prefix ¶
func ValidateNixSystem ¶
func ValidateRepoName ¶
func ValidateWireguardKey ¶
Types ¶
type StateSubDir ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.