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 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 InsertOrganization(ctx context.Context, db gorpmapper.SqlExecutorWithTx, o *Organization) error
- func InsertTimelineFilter(db gorp.SqlExecutor, tf sdk.TimelineFilter, userID string) 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 LoadTimelineFilter(db gorp.SqlExecutor, userID string) (sdk.TimelineFilter, 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 Organization
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 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 InsertOrganization ¶
func InsertOrganization(ctx context.Context, db gorpmapper.SqlExecutorWithTx, o *Organization) error
func InsertTimelineFilter ¶
func InsertTimelineFilter(db gorp.SqlExecutor, tf sdk.TimelineFilter, userID string) error
InsertTimelineFilter inserts user timeline filter
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 LoadTimelineFilter ¶
func LoadTimelineFilter(db gorp.SqlExecutor, userID string) (sdk.TimelineFilter, error)
Load user timeline filter
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 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