authcache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package authcache provides the legacy authorization cache adapter.

Deprecated: use github.com/faustbrian/go-authorization/adapters/cache. This package remains supported for the longer of 180 days after successor public availability and two subsequently published stable root-module minor releases.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifestTooLarge = adapter.ErrManifestTooLarge
	ErrInvalidRevision  = adapter.ErrInvalidRevision
	ErrNilRepository    = adapter.ErrNilRepository
)

Functions

func RepositoryLoader

func RepositoryLoader(
	repository policy.Repository,
) (cache.Loader[authorization.Revision, policy.Manifest], error)

Types

type Config

type Config struct {
	Namespace  string
	Backend    cache.Backend
	TTL        cache.TTLPolicy
	Clock      cache.Clock
	Observer   cache.Observer
	MaxValue   int
	MaxBatch   int
	MaxKeySize int
}

type ManifestCodec

type ManifestCodec struct {
	MaxEncodedSize int
}

func (ManifestCodec) Decode

func (codec ManifestCodec) Decode(encoded []byte) (policy.Manifest, error)

func (ManifestCodec) Encode

func (codec ManifestCodec) Encode(manifest policy.Manifest) ([]byte, error)

type RevisionKeyEncoder

type RevisionKeyEncoder struct{}

func (RevisionKeyEncoder) EncodeKey

func (RevisionKeyEncoder) EncodeKey(revision authorization.Revision) ([]byte, error)

Jump to

Keyboard shortcuts

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