mock_cipher

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

README

pki/mock_cipher

Import path: github.com/InsideGallery/core/pki/mock_cipher

mock_cipher is a generated GoMock package for the legacy pki.Cipher interface. It is generated from pki/cipher.go and is intended for tests that need to set expectations on cipher behavior.

Main API

  • NewMockCipher(ctrl) creates a mock cipher.
  • MockCipher implements the pki.Cipher methods: Encrypt, Decrypt, Kind, ToBinary, and FromBinary.
  • MockCipher.EXPECT() returns the recorder used to define GoMock expectations.
  • MockCipherMockRecorder provides expectation methods for each mocked method.

Usage

package example_test

import (
	"testing"

	"github.com/InsideGallery/core/pki/mock_cipher"
	"go.uber.org/mock/gomock"
)

func TestCipherKind(t *testing.T) {
	ctrl := gomock.NewController(t)
	cipher := mock_cipher.NewMockCipher(ctrl)

	cipher.EXPECT().Kind().Return("test")

	if got := cipher.Kind(); got != "test" {
		t.Fatalf("Kind() = %q, want test", got)
	}
}

Compatibility Notes

Do not edit cipher.go in this package by hand. Regenerate it from pki/cipher.go when the pki.Cipher interface changes.

Documentation

Overview

Package mock_cipher is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCipher

type MockCipher struct {
	// contains filtered or unexported fields
}

MockCipher is a mock of Cipher interface.

func NewMockCipher

func NewMockCipher(ctrl *gomock.Controller) *MockCipher

NewMockCipher creates a new mock instance.

func (*MockCipher) Decrypt

func (m *MockCipher) Decrypt(arg0 []byte) ([]byte, error)

Decrypt mocks base method.

func (*MockCipher) EXPECT

func (m *MockCipher) EXPECT() *MockCipherMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCipher) Encrypt

func (m *MockCipher) Encrypt(arg0 []byte) ([]byte, error)

Encrypt mocks base method.

func (*MockCipher) FromBinary

func (m *MockCipher) FromBinary(arg0 []byte) (cipher.Cipher, error)

FromBinary mocks base method.

func (*MockCipher) Kind

func (m *MockCipher) Kind() string

Kind mocks base method.

func (*MockCipher) ToBinary

func (m *MockCipher) ToBinary() ([]byte, error)

ToBinary mocks base method.

type MockCipherMockRecorder

type MockCipherMockRecorder struct {
	// contains filtered or unexported fields
}

MockCipherMockRecorder is the mock recorder for MockCipher.

func (*MockCipherMockRecorder) Decrypt

func (mr *MockCipherMockRecorder) Decrypt(arg0 any) *gomock.Call

Decrypt indicates an expected call of Decrypt.

func (*MockCipherMockRecorder) Encrypt

func (mr *MockCipherMockRecorder) Encrypt(arg0 any) *gomock.Call

Encrypt indicates an expected call of Encrypt.

func (*MockCipherMockRecorder) FromBinary

func (mr *MockCipherMockRecorder) FromBinary(arg0 any) *gomock.Call

FromBinary indicates an expected call of FromBinary.

func (*MockCipherMockRecorder) Kind

func (mr *MockCipherMockRecorder) Kind() *gomock.Call

Kind indicates an expected call of Kind.

func (*MockCipherMockRecorder) ToBinary

func (mr *MockCipherMockRecorder) ToBinary() *gomock.Call

ToBinary indicates an expected call of ToBinary.

Jump to

Keyboard shortcuts

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