Documentation ¶
Index ¶
- Constants
- Variables
- func AssertPathExists(paths ...string) error
- func AssertPathNotExists(paths ...string) error
- func Base64Decode(b []byte) ([]byte, error)
- func Close(o io.Closer)
- func CopyDirectory(src, dest string) error
- func EnsureDirectoryExists(path string) error
- func IsIrmaconfDir(dir string) (bool, error)
- func IsScheme(dir string, expectSignature bool) (bool, error)
- func IsTempSchemeDir(dirname string) bool
- func IterateSubfolders(path string, handler func(string, os.FileInfo) error) error
- func NewPairingCode() string
- func NewRandomString(count int, characterSet string) string
- func NewSessionToken() string
- func ParseLDContext(bts []byte) (string, error)
- func ParseNestedLDContext(bts []byte) (string, error)
- func PathExists(path string) (bool, error)
- func RandomBigInt(limit *big.Int) *big.Int
- func ReadKey(key, path string) ([]byte, error)
- func SaveFile(fpath string, content []byte) (err error)
- func SchemeFilename(dir string) (string, error)
- func SchemeInfo(filename string, bts []byte) (string, string, error)
- func Stat(path string) (os.FileInfo, bool, error)
- func Unmarshal(filename string, bts []byte, dest interface{}) error
- func ValidateSchemeID(id string) error
- func WalkDir(path string, handler func(string, os.FileInfo) error) error
- type SSECtx
Constants ¶
const ( AlphanumericChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" NumericChars = "0123456789" SessionTokenRegex = "[" + AlphanumericChars + "]{20}" )
Variables ¶
var ForceHTTPS = true
ForceHTTPS disables HTTP forcing in irma.HTTPTransport for all instances, regardless of the instance's ForceHTTPS member. Only for use in unit tests.
var Logger *logrus.Logger
var SchemeFilenames = []string{"description.xml", "description.json"}
Functions ¶
func AssertPathExists ¶
AssertPathExists returns nil only if it has been successfully verified that all specified paths exists.
func AssertPathNotExists ¶
func Base64Decode ¶
Base64Decode decodes the specified bytes as any of the Base64 dialects: standard encoding (+, /) and URL encoding (-, _), with or without padding.
func Close ¶ added in v0.8.0
Close is a helper for absorbing errors in the `defer x.Close()` pattern
func CopyDirectory ¶
func EnsureDirectoryExists ¶
func IsIrmaconfDir ¶ added in v0.6.0
func IsTempSchemeDir ¶ added in v0.11.2
func IterateSubfolders ¶
IterateSubfolders iterates over the subfolders of the specified path, calling the specified handler each time. If anything goes wrong, or if the caller returns a non-nil error, an error is immediately returned.
func NewPairingCode ¶ added in v0.8.0
func NewPairingCode() string
func NewRandomString ¶ added in v0.8.0
func NewSessionToken ¶
func NewSessionToken() string
func ParseLDContext ¶ added in v0.9.0
func ParseNestedLDContext ¶ added in v0.9.0
func PathExists ¶
PathExists checks if the specified path exists.
func ReadKey ¶
ReadKey returns either the content of the file specified at path, if it exists, or []byte(key) otherwise. It is an error to specify both or none arguments, or specify an empty or unreadable file. If there is no error then the return []byte is non-empty.
func SaveFile ¶
SaveFile saves the file contents at the specified path atomically: - first save the content in a temp file with a random filename in the same dir - then rename the temp file to the specified filepath, overwriting the old file