user

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: BSD-3-Clause Imports: 10 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoadOptions = struct {
	WithContacts     LoadOptionFunc
	WithOrganization LoadOptionFunc
}{
	WithContacts:     loadContacts,
	WithOrganization: loadOrganization,
}

LoadOptions for authentified users.

Functions

func CountAdmin

func CountAdmin(db gorp.SqlExecutor) (int64, error)

CountAdmin admin users in database.

func CountTimelineFilter

func CountTimelineFilter(db gorp.SqlExecutor, userID string) (int64, error)

CountTimelineFilter count if user has a timeline filter

func DeleteByID

func DeleteByID(db gorp.SqlExecutor, id string) error

DeleteByID a user in database.

func Insert

Insert a user in database.

func InsertContact

func InsertContact(ctx context.Context, db gorpmapper.SqlExecutorWithTx, c *sdk.UserContact) error

InsertContact in database.

func InsertTimelineFilter

func InsertTimelineFilter(db gorp.SqlExecutor, tf sdk.TimelineFilter, userID string) error

InsertTimelineFilter inserts user timeline filter

func LoadAll

LoadAll returns all users from database.

func LoadAllByIDs

func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []string, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)

LoadAllByIDs returns users from database for given ids.

func LoadAllByRing

func LoadAllByRing(ctx context.Context, db gorp.SqlExecutor, ring string, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)

LoadAllByRing returns users from database for given ids.

func LoadByID

func LoadByID(ctx context.Context, db gorp.SqlExecutor, id string, opts ...LoadOptionFunc) (*sdk.AuthentifiedUser, error)

LoadByID returns a user from database for given id.

func LoadByUsername

func LoadByUsername(ctx context.Context, db gorp.SqlExecutor, username string, opts ...LoadOptionFunc) (*sdk.AuthentifiedUser, error)

LoadByUsername returns a user from database for given username.

func LoadContactByTypeAndValue

func LoadContactByTypeAndValue(ctx context.Context, db gorp.SqlExecutor, contactType, value string) (*sdk.UserContact, error)

LoadContactByTypeAndValue returns a contact for given type and value.

func LoadContactsByUserIDs

func LoadContactsByUserIDs(ctx context.Context, db gorp.SqlExecutor, userIDs []string) ([]sdk.UserContact, error)

LoadContactsByUserIDs returns all contacts from database for given user ids.

func LoadTimelineFilter

func LoadTimelineFilter(db gorp.SqlExecutor, userID string) (sdk.TimelineFilter, error)

Load user timeline filter

func Update

Update a user in database.

func UpdateContact

func UpdateContact(ctx context.Context, db gorpmapper.SqlExecutorWithTx, c *sdk.UserContact) error

UpdateContact in database.

func UpdateTimelineFilter

func UpdateTimelineFilter(db gorp.SqlExecutor, timelineFilter sdk.TimelineFilter, userID string) error

UpdateTimelineFilter user timeline filter

Types

type LoadOptionFunc

type LoadOptionFunc func(context.Context, gorp.SqlExecutor, ...*sdk.AuthentifiedUser) error

LoadOptionFunc loads data on given authentified users.

type Organization

type Organization struct {
	ID                 int64  `db:"id"`
	AuthentifiedUserID string `db:"authentified_user_id"`
	Organization       string `db:"organization"`
	gorpmapper.SignedEntity
}

func LoadOrganizationByUserID

func LoadOrganizationByUserID(ctx context.Context, db gorp.SqlExecutor, userID string) (*Organization, error)

func LoadOrganizationsByUserIDs

func LoadOrganizationsByUserIDs(ctx context.Context, db gorp.SqlExecutor, userIDs []string) ([]Organization, error)

func (Organization) Canonical

func (o Organization) Canonical() gorpmapper.CanonicalForms

Jump to

Keyboard shortcuts

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