util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ToBytes = func(r interface{}) ([]byte, error) {
	switch v := r.(type) {
	case string:
		return []byte(v), nil
	case []byte:
		return v, nil
	default:
		return nil, fmt.Errorf("failed to convert '%v' to bytes", r)
	}
}
View Source
var ToString = func(r interface{}) (string, error) {
	switch v := r.(type) {
	case string:
		return v, nil
	case []byte:
		return string(v), nil
	default:
		return "", fmt.Errorf("failed to convert '%v' to bytes", r)
	}
}

Functions

func ToPEM

func ToPEM(fileContent string, password string, chainDelimiter string) ([]byte, []byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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