hashattr

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ATTR_KEY   = "github.com/mandelsoft/ocm/hasher"
	ATTR_SHORT = "hasher"
)
View Source
const (
	ConfigType   = "hasher" + cfgcpi.OCM_CONFIG_TYPE_SUFFIX
	ConfigTypeV1 = ConfigType + runtime.VersionSeparator + "v1"
)

Variables

This section is empty.

Functions

func Set

func Set(ctx ContextProvider, hasher string) error

Types

type Attribute

type Attribute struct {
	DefaultHasher string
}

func Get

func Get(ctx ContextProvider) *Attribute

func (*Attribute) GetHasher

func (a *Attribute) GetHasher(ctx ContextProvider, names ...string) Hasher

type AttributeType

type AttributeType struct{}

func (AttributeType) Convert

func (a AttributeType) Convert(v interface{}) (interface{}, error)

func (AttributeType) Decode

func (a AttributeType) Decode(data []byte, unmarshaller runtime.Unmarshaler) (interface{}, error)

func (AttributeType) Description

func (a AttributeType) Description() string

func (AttributeType) Encode

func (a AttributeType) Encode(v interface{}, marshaller runtime.Marshaler) ([]byte, error)

func (AttributeType) Name

func (a AttributeType) Name() string

type Config

type Config struct {
	runtime.ObjectVersionedType `json:",inline"`
	HashAlgorithm               string `json:"hashAlgorithm"`
}

Config describes a memory based repository interface.

func New

func New(algo string) *Config

New creates a new memory ConfigSpec.

func (*Config) ApplyTo

func (a *Config) ApplyTo(ctx cfgcpi.Context, target interface{}) error

func (*Config) GetType

func (a *Config) GetType() string

type Context

type Context = ocm.Context

type ContextProvider

type ContextProvider = ocm.ContextProvider

type Hasher

type Hasher = ocm.Hasher

Jump to

Keyboard shortcuts

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