Documentation

Overview

    Package cachefile implements the file format for session caches.

    Package filesession implements a simple YAML file-based login.sessionCache.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Cache

    type Cache struct {
    	// contains filtered or unexported fields
    }

    func New

    func New(path string, options ...Option) *Cache

      New returns a login.SessionCache implementation backed by the specified file path.

      func (*Cache) GetToken

      func (c *Cache) GetToken(key oidcclient.SessionCacheKey) *oidctypes.Token

        GetToken looks up the cached data for the given parameters. It may return nil if no valid matching session is cached.

        func (*Cache) PutToken

        func (c *Cache) PutToken(key oidcclient.SessionCacheKey, token *oidctypes.Token)

          PutToken stores the provided token into the session cache under the given parameters. It does not return an error but may silently fail to update the session cache.

          type Option

          type Option func(*Cache)

            Option configures a cache in New().

            func WithErrorReporter

            func WithErrorReporter(reporter func(error)) Option

              WithErrorReporter is an Option that specifies a callback which will be invoked for each error reported during session cache operations. By default, these errors are silently ignored.