accounts

package
v2.27.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           uint64
	Email        sql.NullString
	UserID       string
	DisplayName  sql.NullString
	Quota        sql.NullString
	LastLogin    int
	Backend      string
	Home         string
	State        int8
	Username     sql.NullString // optional comes from the oc_preferences
	OwnCloudUUID sql.NullString // optional comes from the oc_preferences
}

Account stores information about accounts.

type Accounts

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

Accounts represents oc10-style Accounts

func New

func New(driver string, sqldb *sql.DB, joinUsername, joinUUID, enableMedialSearch bool) (*Accounts, error)

New returns a new Cache instance connecting to the given sql.DB

func NewMysql

func NewMysql(dsn string, joinUsername, joinUUID, enableMedialSearch bool) (*Accounts, error)

NewMysql returns a new Cache instance connecting to a MySQL database

func (*Accounts) FindAccounts

func (as *Accounts) FindAccounts(ctx context.Context, query string) ([]Account, error)

FindAccounts searches userid, displayname and email using the given query. The Wildcard caracters % and _ are escaped.

func (*Accounts) GetAccountByClaim

func (as *Accounts) GetAccountByClaim(ctx context.Context, claim, value string) (*Account, error)

GetAccountByClaim fetches an account by mail, username or userid

func (*Accounts) GetAccountGroups

func (as *Accounts) GetAccountGroups(ctx context.Context, uid string) ([]string, error)

GetAccountGroups lasts the groups for an account

type Scannable

type Scannable interface {
	Scan(...interface{}) error
}

Scannable describes the interface providing a Scan method

Jump to

Keyboard shortcuts

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