Documentation ¶
Index ¶
- Variables
- func CountAdmin(db gorp.SqlExecutor) (int64, error)
- func CountTimelineFilter(db gorp.SqlExecutor, userID string) (int64, error)
- func DeleteByID(db gorp.SqlExecutor, id string) error
- func DeleteGPGKey(db gorpmapper.SqlExecutorWithTx, gpgKey sdk.UserGPGKey) error
- func Get(ctx context.Context, db gorp.SqlExecutor, q gorpmapping.Query, ...) (*sdk.AuthentifiedUser, error)
- func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, au *sdk.AuthentifiedUser) error
- func InsertContact(ctx context.Context, db gorpmapper.SqlExecutorWithTx, c *sdk.UserContact) error
- func InsertGPGKey(ctx context.Context, db gorpmapper.SqlExecutorWithTx, gpgKey *sdk.UserGPGKey) error
- func InsertOldUserOrganisation(ctx context.Context, db gorpmapper.SqlExecutorWithTx, userID, orgaName string) error
- func InsertTimelineFilter(db gorp.SqlExecutor, tf sdk.TimelineFilter, userID string) error
- func InsertUserOrganization(ctx context.Context, db gorpmapper.SqlExecutorWithTx, o *UserOrganization) error
- func LoadAll(ctx context.Context, db gorp.SqlExecutor, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)
- func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []string, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)
- func LoadAllByRing(ctx context.Context, db gorp.SqlExecutor, ring string, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, id string, opts ...LoadOptionFunc) (*sdk.AuthentifiedUser, error)
- func LoadByUsername(ctx context.Context, db gorp.SqlExecutor, username string, ...) (*sdk.AuthentifiedUser, error)
- func LoadContactByTypeAndValue(ctx context.Context, db gorp.SqlExecutor, contactType, value string) (*sdk.UserContact, error)
- func LoadContactsByUserIDs(ctx context.Context, db gorp.SqlExecutor, userIDs []string) ([]sdk.UserContact, error)
- func LoadGPGKeyByKeyID(ctx context.Context, db gorp.SqlExecutor, keyID string) (*sdk.UserGPGKey, error)
- func LoadGPGKeysByUserID(ctx context.Context, db gorp.SqlExecutor, userID string) ([]sdk.UserGPGKey, error)
- func LoadTimelineFilter(db gorp.SqlExecutor, userID string) (sdk.TimelineFilter, error)
- func LoadUsersWithoutOrganization(ctx context.Context, db gorp.SqlExecutor) ([]sdk.AuthentifiedUser, error)
- func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, au *sdk.AuthentifiedUser) error
- func UpdateContact(ctx context.Context, db gorpmapper.SqlExecutorWithTx, c *sdk.UserContact) error
- func UpdateTimelineFilter(db gorp.SqlExecutor, timelineFilter sdk.TimelineFilter, userID string) error
- type LoadOptionFunc
- type OrganizationOld
- type UserOrganization
Constants ¶
This section is empty.
Variables ¶
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 Get ¶
func Get(ctx context.Context, db gorp.SqlExecutor, q gorpmapping.Query, opts ...LoadOptionFunc) (*sdk.AuthentifiedUser, error)
func Insert ¶
func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, au *sdk.AuthentifiedUser) error
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 ¶
func LoadAll(ctx context.Context, db gorp.SqlExecutor, opts ...LoadOptionFunc) (sdk.AuthentifiedUsers, error)
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 ¶
func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, au *sdk.AuthentifiedUser) error
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
func (o OrganizationOld) Canonical() gorpmapper.CanonicalForms
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
func (o UserOrganization) Canonical() gorpmapper.CanonicalForms