user

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 12 Imported by: 15

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 DeleteGPGKey added in v0.52.0

func DeleteGPGKey(db gorpmapper.SqlExecutorWithTx, gpgKey sdk.UserGPGKey) error

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 InsertGPGKey added in v0.52.0

func InsertGPGKey(ctx context.Context, db gorpmapper.SqlExecutorWithTx, gpgKey *sdk.UserGPGKey) error

func InsertOldUserOrganisation added in v0.53.0

func InsertOldUserOrganisation(ctx context.Context, db gorpmapper.SqlExecutorWithTx, userID, orgaName string) error

func InsertTimelineFilter

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

InsertTimelineFilter inserts user timeline filter

func InsertUserOrganization added in v0.53.0

func InsertUserOrganization(ctx context.Context, db gorpmapper.SqlExecutorWithTx, o *UserOrganization) error

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 LoadGPGKeyByKeyID added in v0.52.0

func LoadGPGKeyByKeyID(ctx context.Context, db gorp.SqlExecutor, keyID string) (*sdk.UserGPGKey, error)

func LoadGPGKeysByUserID added in v0.52.0

func LoadGPGKeysByUserID(ctx context.Context, db gorp.SqlExecutor, userID string) ([]sdk.UserGPGKey, error)

func LoadTimelineFilter

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

Load user timeline filter

func LoadUsersWithoutOrganization added in v0.52.0

func LoadUsersWithoutOrganization(ctx context.Context, db gorp.SqlExecutor) ([]sdk.AuthentifiedUser, error)

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 OrganizationOld added in v0.53.0

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

func LoadOldOrganizationsByUserIDs added in v0.53.0

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

func (OrganizationOld) Canonical added in v0.53.0

type UserOrganization added in v0.53.0

type UserOrganization struct {
	ID                 string `db:"id"`
	AuthentifiedUserID string `db:"authentified_user_id"`
	OrganizationID     string `db:"organization_id"`
	gorpmapper.SignedEntity
}

func LoadAllUserOrganizationsByUserIDs added in v0.53.0

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

func (UserOrganization) Canonical added in v0.53.0

Jump to

Keyboard shortcuts

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