postgres

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 12 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 (s *Storage) Abandon(ctx context.Context, accessToken string) (bool, error)

Abandon implements storage interface.

func (*Storage) Collect

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

Collect implements prometheus Collector interface.

func (*Storage) Delete

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

Delete implements storage interface.

func (*Storage) Describe

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

Describe implements prometheus Collector interface.

func (*Storage) Exists

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

Exists implements storage interface.

func (*Storage) Get

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

Get implements storage interface.

func (*Storage) List

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

sessionManagerList implements storage interface.

func (*Storage) SetValue

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

SetValue implements storage interface.

func (*Storage) Setup

func (s *Storage) Setup() error

Setup implements storage interface.

func (*Storage) Start

func (s *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 (s *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