Help us shape the future of Go! Take the 2026 Go Developer Survey

crypto

package
v1.41.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package crypto provides a lightweight fake implementation of security.Cryptor for use in tests. It lives in its own leaf package (no dependency on internal/usecase/devices) so it can be imported by both internal (package foo) and external (package foo_test) test files without creating an import cycle through internal/mocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCrypto

type MockCrypto struct{}

func (MockCrypto) Decrypt

func (c MockCrypto) Decrypt(_ string) (string, error)

func (MockCrypto) Encrypt

func (c MockCrypto) Encrypt(_ string) (string, error)

Encrypt encrypts a string.

func (MockCrypto) EncryptWithKey

func (c MockCrypto) EncryptWithKey(_, _ string) (string, error)

EncryptWithKey encrypts a string with the provided key.

func (MockCrypto) GenerateKey

func (c MockCrypto) GenerateKey() string

func (MockCrypto) ReadAndDecryptFile

func (c MockCrypto) ReadAndDecryptFile(_ string) (config.Configuration, error)

ReadAndDecryptFile reads encrypted data from a file and decrypts it.

Jump to

Keyboard shortcuts

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