postgres

package
Version: v0.0.0-...-1a7bac6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceStore

type NonceStore struct {
	DB *Store
}

NonceStore is a nonce store backed by database

func (*NonceStore) Accept

func (s *NonceStore) Accept(endpoint, nonce string) error

Accept implements openid.NonceStore.Accept

type Store

type Store struct {
	*sql.DB
	// contains filtered or unexported fields
}

Store implements an in-memory store for testing

func OpenStore

func OpenStore(driver, dataSource string) *Store

OpenStore returns an open database connection

func (*Store) CreateUser

func (db *Store) CreateUser(user datastore.User) (int64, error)

CreateUser creates a new user

func (*Store) GetUser

func (db *Store) GetUser(username string) (datastore.User, error)

GetUser gets an existing user

func (*Store) OpenIDNonceStore

func (db *Store) OpenIDNonceStore() openid.NonceStore

OpenIDNonceStore returns an openid nonce store

func (*Store) OrgUserAccess

func (db *Store) OrgUserAccess(orgID, username string, role int) bool

OrgUserAccess checks if the user has permissions to access the organization

func (*Store) OrganizationCreate

func (db *Store) OrganizationCreate(org datastore.Organization) error

OrganizationCreate creates a new organization

func (*Store) OrganizationForUserToggle

func (db *Store) OrganizationForUserToggle(orgID, username string) error

OrganizationForUserToggle toggles the user access to an organization

func (*Store) OrganizationGet

func (db *Store) OrganizationGet(orgID string) (datastore.Organization, error)

OrganizationGet returns an organization

func (*Store) OrganizationUpdate

func (db *Store) OrganizationUpdate(org datastore.Organization) error

OrganizationUpdate updates an organization

func (*Store) OrganizationsForUser

func (db *Store) OrganizationsForUser(username string) ([]datastore.Organization, error)

OrganizationsForUser returns the organizations a user can access

func (*Store) UserDelete

func (db *Store) UserDelete(username string) error

UserDelete removes a user

func (*Store) UserList

func (db *Store) UserList() ([]datastore.User, error)

UserList lists existing users

func (*Store) UserUpdate

func (db *Store) UserUpdate(user datastore.User) error

UserUpdate updates a user

Jump to

Keyboard shortcuts

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