pg

package
v0.0.0-...-987a2ef Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package pg is a osin storage implementation for postgres.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	Id int `sql:"id,pk" json:"id"`

	*osin.AccessData
	// contains filtered or unexported fields
}

type Client

type Client struct {
	ID          string     `sql:"id,pk" json:"id"`
	Secret      string     `sql:"secret,notnull" json:"-"`
	RedirectURI string     `sql:"redirect_uri,notnull" json:"redirect_uri"`
	Meta        ClientMeta `sql:"meta,notnull" json:"meta,omitempty"`
	CreatedAt   time.Time  `sql:"created,notnull" json:"created,omitempty"`
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(id, secret, uri string) (c *Client)

NewClient ...

func (*Client) CopyFrom

func (c *Client) CopyFrom(other storage.Client)

CopyFrom ...

func (*Client) GetId

func (c *Client) GetId() string

GetId osin.Client

func (*Client) GetName

func (c *Client) GetName() string

GetName ...

func (*Client) GetRedirectUri

func (c *Client) GetRedirectUri() string

GetRedirectUri osin.Client

func (*Client) GetSecret

func (c *Client) GetSecret() string

GetSecret osin.Client

func (*Client) GetUserData

func (c *Client) GetUserData() interface{}

GetUserData osin.Client

func (*Client) String

func (c *Client) String() string

type ClientMeta

type ClientMeta struct {
	Site uint8  `json:"siteID"`
	Name string `json:"name"`
}

ClientMeta ...

type DB

type DB = pg.DB

DB ...

type JSONKV

type JSONKV map[string]interface{}

JSONKV ..

func ToJSONKV

func ToJSONKV(src interface{}) (JSONKV, error)

ToJSONKV ...

func (JSONKV) WithKey

func (m JSONKV) WithKey(key string) (v interface{})

WithKey ...

type Query

type Query = orm.Query

Query ...

type Result

type Result interface {

	// RowsAffected returns the number of rows affected by SELECT, INSERT, UPDATE,
	// or DELETE queries. It returns -1 if query can't possibly affect any rows,
	// e.g. in case of CREATE or SHOW queries.
	RowsAffected() int

	// RowsReturned returns the number of rows returned by the query.
	RowsReturned() int
}

Result ...

type Storage

type Storage interface {
	storage.Storage
	AllClients() ([]Client, error)
	CreateSchemas() error
}

Storage ...

func New

func New(db *DB) Storage

New returns a new postgres storage instance.

type Tx

type Tx = pg.Tx

Tx ...

Jump to

Keyboard shortcuts

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