postgres

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorage

func NewStorage(opts StorageOpts) storage.Storage

Types

type Storage

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

func (*Storage) Abandon

func (ps *Storage) Abandon(ctx context.Context, accessToken string) (bool, error)

Abandon implements storage interface.

func (*Storage) Collect

func (c *Storage) Collect(in chan<- prometheus.Metric)

Collect implements prometheus Collector interface.

func (*Storage) Delete

func (ps *Storage) Delete(ctx context.Context, subjectID, accessToken, refreshToken string, expiredAtFrom, expiredAtTo *time.Time) (int64, error)

Delete implements storage interface.

func (*Storage) Describe

func (c *Storage) Describe(in chan<- *prometheus.Desc)

Describe implements prometheus Collector interface.

func (*Storage) Exists

func (ps *Storage) Exists(ctx context.Context, accessToken string) (exists bool, err error)

Exists implements storage interface.

func (*Storage) Get

func (ps *Storage) Get(ctx context.Context, accessToken string) (*mnemosynerpc.Session, error)

Get implements storage interface.

func (*Storage) List

func (ps *Storage) List(ctx context.Context, offset, limit int64, expiredAtFrom, expiredAtTo *time.Time) ([]*mnemosynerpc.Session, error)

sessionManagerList implements storage interface.

func (*Storage) SetValue

func (ps *Storage) SetValue(ctx context.Context, accessToken string, key, value string) (map[string]string, error)

SetValue implements storage interface.

func (*Storage) Setup

func (ps *Storage) Setup() error

Setup implements storage interface.

func (*Storage) Start

func (ps *Storage) Start(ctx context.Context, accessToken, refreshToken, sid, sc string, b map[string]string) (*mnemosynerpc.Session, error)

Start implements storage interface.

func (*Storage) TearDown

func (ps *Storage) TearDown() error

TearDown implements storage interface.

type StorageOpts

type StorageOpts struct {
	Conn          *sql.DB
	Schema, Table string
	Namespace     string
	TTL           time.Duration
}

Jump to

Keyboard shortcuts

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