utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoWriteFile

func AutoWriteFile(file_path string, data []byte, mode fs.FileMode) error

auto create file

func ConfigRead

func ConfigRead(path string, config BaseConfig) error

func GenerateCACertificate

func GenerateCACertificate() (*x509.Certificate, *rsa.PrivateKey)

func HasFile

func HasFile(path string) bool

func RandomString

func RandomString(n int) string

func ReadJsonFile

func ReadJsonFile(path string, data any) error

read json file

func WriteJsonFile

func WriteJsonFile(path string, data any) error

write json file

Types

type BaseConfig

type BaseConfig interface {
	Default() any
}

type Certificate

type Certificate struct {
	ServerKey []byte
	ServerPem []byte
}

func GenerateCertificate

func GenerateCertificate(ca *x509.Certificate, caKey *rsa.PrivateKey, organizations []string) Certificate

Jump to

Keyboard shortcuts

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