Documentation ¶
Index ¶
- Constants
- func BitsToBytes(ba bitarray.BitArray) []byte
- func BytesToBits(bytes []byte) bitarray.BitArray
- func CompressData(data []byte) ([]byte, error)
- func CreateDir(path string)
- func CreateFile(path string)
- func DecompressData(compressedData []byte) ([]byte, error)
- func DeleteFilesAndDirectories(path string) error
- func GetCurrentMinute() string
- func GetCurrentPeriod() string
- func GetCurrentSecond() string
- func GetCurrentTimestamp() string
- func GetRandomLatency(min int, max int) int
- func GetSenderURL(r *http.Request) string
- func Getwaitingtime(MMD int) int
- func IsOwner(ownerURL string, parsedURL string) bool
- func LoadConfiguration(config interface{}, file string)
- func PEM2PK(s string) crypto.PublicKey
- func PEM2PrivKey(s string) crypto.PrivateKey
- func ParseTBSCertificate(cert *x509.Certificate) *x509.Certificate
- func ReadByte(filename string) ([]byte, error)
- func ReadCertificateFromDisk(filePath string) ([]byte, error)
- func ReadKeyFromDisk(filePath string) (*rsa.PrivateKey, error)
- func SaveCertificateToDisk(certBytes []byte, filePath string)
- func SaveKeyToDisk(privKey *rsa.PrivateKey, filePath string)
- func WriteData(filename string, data interface{}) error
- type OutOfBounds
Constants ¶
View Source
const ( RED = "\x1b[31m" GREEN = "\x1b[32m" YELLOW = "\x1b[33m" BLUE = "\x1b[34m" RESET = "\x1b[0m" )
Terminal colors. Use by adding the color to the beginning of a string. add RESET after the string to reset the color: otherwise all text will remain this color in future prints.
Variables ¶
This section is empty.
Functions ¶
func BitsToBytes ¶
func BytesToBits ¶
func CompressData ¶
func CreateFile ¶
func CreateFile(path string)
func DecompressData ¶
func GetCurrentMinute ¶
func GetCurrentMinute() string
func GetCurrentPeriod ¶
func GetCurrentPeriod() string
set it to be the same as GetCurrentMinute() for now
func GetCurrentSecond ¶
func GetCurrentSecond() string
func GetCurrentTimestamp ¶
func GetCurrentTimestamp() string
func GetRandomLatency ¶
func GetSenderURL ¶
func Getwaitingtime ¶
This needs to be changed with GetCurrentPeriod()
func IsOwner ¶
Rules: If localhost, call it true. Otherwise compare the pre-port part of the url to see if they match.
func LoadConfiguration ¶
func LoadConfiguration(config interface{}, file string)
func PEM2PrivKey ¶
func PEM2PrivKey(s string) crypto.PrivateKey
func ParseTBSCertificate ¶
func ParseTBSCertificate(cert *x509.Certificate) *x509.Certificate
func ReadCertificateFromDisk ¶
func ReadKeyFromDisk ¶
func ReadKeyFromDisk(filePath string) (*rsa.PrivateKey, error)
func SaveCertificateToDisk ¶
func SaveKeyToDisk ¶
func SaveKeyToDisk(privKey *rsa.PrivateKey, filePath string)
Types ¶
type OutOfBounds ¶
type OutOfBounds struct{}
func (*OutOfBounds) Error ¶
func (e *OutOfBounds) Error() string
Click to show internal directories.
Click to hide internal directories.