plain

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package plain implements a plaintext backend

Index

Constants

View Source
const (
	// Name is the name of this backend.
	Name = "plain"
	// Ext is the file extension used by this backend.
	Ext = "txt"
	// IDFile is the name of the recipients file used by this backend.
	IDFile = ".plain-id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocker

type Mocker struct{}

Mocker is a no-op GPG mock.

func New

func New() *Mocker

New creates a new GPG mock.

func (*Mocker) Binary

func (m *Mocker) Binary() string

Binary always returns 'gpg'.

func (*Mocker) Concurrency added in v1.13.0

func (m *Mocker) Concurrency() int

Concurrency returns the number of CPUs.

func (*Mocker) Decrypt

func (m *Mocker) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)

Decrypt read the file from disk unaltered.

func (*Mocker) Encrypt

func (m *Mocker) Encrypt(ctx context.Context, content []byte, recipients []string) ([]byte, error)

Encrypt writes the input to disk unaltered.

func (*Mocker) Ext

func (m *Mocker) Ext() string

Ext returns gpg.

func (*Mocker) FindIdentities

func (m *Mocker) FindIdentities(ctx context.Context, keys ...string) ([]string, error)

FindIdentities does nothing.

func (*Mocker) FindRecipients

func (m *Mocker) FindRecipients(ctx context.Context, keys ...string) ([]string, error)

FindRecipients does nothing.

func (*Mocker) Fingerprint

func (m *Mocker) Fingerprint(ctx context.Context, id string) string

Fingerprint returns thd id.

func (*Mocker) FormatKey

func (m *Mocker) FormatKey(ctx context.Context, id, tpl string) string

FormatKey returns the id.

func (*Mocker) GenerateIdentity

func (m *Mocker) GenerateIdentity(ctx context.Context, name, email, pw string) error

GenerateIdentity is not implemented.

func (*Mocker) IDFile

func (m *Mocker) IDFile() string

IDFile returns the name of the recipients file.

func (*Mocker) ImportPublicKey

func (m *Mocker) ImportPublicKey(context.Context, []byte) error

ImportPublicKey does nothing.

func (*Mocker) Initialized

func (m *Mocker) Initialized(context.Context) error

Initialized returns nil.

func (*Mocker) ListIdentities

func (m *Mocker) ListIdentities(context.Context) ([]string, error)

ListIdentities does nothing.

func (*Mocker) ListRecipients

func (m *Mocker) ListRecipients(context.Context) ([]string, error)

ListRecipients does nothing.

func (*Mocker) Name

func (m *Mocker) Name() string

Name returns plain, the name of the backend.

func (*Mocker) ReadNamesFromKey

func (m *Mocker) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)

ReadNamesFromKey does nothing.

func (*Mocker) RecipientIDs

func (m *Mocker) RecipientIDs(context.Context, []byte) ([]string, error)

RecipientIDs does nothing.

func (*Mocker) Version

func (m *Mocker) Version(context.Context) semver.Version

Version returns dummy version info.

Jump to

Keyboard shortcuts

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