cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 0 Imported by: 22

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

Jump to

Keyboard shortcuts

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