package cache

import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"

Package cache allows third parties to implement external storage for caching token data for distributed systems or multiple local applications access.

The data stored and extracted will represent the entire cache. Therefore it is recommended one msal instance per user. This data is considered opaque and there are no guarantees to implementers on the format being passed.

Index

Types

type ExportReplace

type ExportReplace interface {
	// Replace replaces the cache with what is in external storage.
	// key is the suggested key which can be used for partioning the cache
	Replace(cache Unmarshaler, key string)
	// Export writes the binary representation of the cache (cache.Marshal()) to
	// external storage. This is considered opaque.
	// key is the suggested key which can be used for partioning the cache
	Export(cache Marshaler, key string)
}

ExportReplace is used export or replace what is in the cache.

type Marshaler

type Marshaler interface {
	Marshal() ([]byte, error)
}

Marshaler marshals data from an internal cache to bytes that can be stored.

type Serializer

type Serializer interface {
	Marshaler
	Unmarshaler
}

Serializer can serialize the cache to binary or from binary into the cache.

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte) error
}

Unmarshaler unmarshals data from a storage medium into the internal cache, overwriting it.

Source Files

cache.go

Version
v0.5.3
Published
Jul 18, 2022
Platform
windows/amd64
Last checked
2 weeks ago

Tools for package owners.