postgres

package
v0.0.0-...-a11ed81 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package postgres provides the postgres based DataStore implementation

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 (s *Store) CreateUser(user datastore.User) (int64, error)

CreateUser creates a new user

func (Store) GetSettings

func (s Store) GetSettings() ([]models.Setting, error)

GetSettings gets an array of models.Setting or an error

func (*Store) GetUser

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

GetUser gets an existing user

func (*Store) OpenIDNonceStore

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

OpenIDNonceStore returns an openid nonce store

func (*Store) OrgUserAccess

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

OrgUserAccess checks if the user has permissions to access the organization

func (*Store) OrganizationCreate

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

OrganizationCreate creates a new organization

func (*Store) OrganizationForUserToggle

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

OrganizationForUserToggle toggles the user access to an organization

func (*Store) OrganizationGet

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

OrganizationGet returns an organization

func (*Store) OrganizationUpdate

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

OrganizationUpdate updates an organization

func (*Store) OrganizationsForUser

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

OrganizationsForUser returns the organizations a user can access

func (Store) Set

func (s Store) Set(key string, value string) error

Set sets the value of a given key in settings

func (*Store) UserDelete

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

UserDelete removes a user

func (*Store) UserList

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

UserList lists existing users

func (*Store) UserUpdate

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