settingstest

package
v1.88.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package settingstest is an organisation's own account in memory: the document and the SecureString parameters the controller reads with the role it assumes. For tests only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter struct {
	Value   string
	Version int64
}

Parameter is one parameter of the account.

type Reader

type Reader map[string]*Source

Reader is the sources of several organisations.

func (Reader) For

func (r Reader) For(org string) (orgsettings.Source, bool)

For implements the controller's SettingsReader.

type Source

type Source struct {

	// Doc is the document's text; DocErr, when set, is why it cannot be read.
	Doc    string
	DocErr error
	// Parameters are the account's SecureString parameters, by name.
	Parameters map[string]Parameter
	// Reads counts the values decrypted, by parameter name: a secret that
	// did not change is not decrypted again.
	Reads map[string]int
	// contains filtered or unexported fields
}

Source is one organisation's account.

func New

func New(doc string) *Source

New is an account holding the document.

func (*Source) Document

func (s *Source) Document(context.Context) ([]byte, error)

Document implements orgsettings.Source.

func (*Source) Put

func (s *Source) Put(name, value string)

Put writes a parameter, which is a new version when it exists.

func (*Source) SetDocument

func (s *Source) SetDocument(doc string)

SetDocument replaces the document.

func (*Source) Value

func (s *Source) Value(_ context.Context, name string) (string, int64, error)

Value implements orgsettings.Secrets.

func (*Source) Version

func (s *Source) Version(_ context.Context, name string) (int64, error)

Version implements orgsettings.Secrets.

Jump to

Keyboard shortcuts

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