Documentation ¶
Index ¶
- func SQLBool(value bool) int
- type APIKeySQL
- type AppSQL
- type ChangeLogSQL
- type FacebookSSOSql
- type FeatureToggleSQL
- type GithubSSOSql
- type GoogleSSOSql
- type ShortLinkSQL
- func (s ShortLinkSQL) CreateShortLink(shortLinkInput entity.ShortLinkInput) error
- func (s ShortLinkSQL) DeleteShortLink(alias string) error
- func (s ShortLinkSQL) GetShortLinkByAlias(alias string) (entity.ShortLink, error)
- func (s ShortLinkSQL) GetShortLinksByAliases(aliases []string) ([]entity.ShortLink, error)
- func (s ShortLinkSQL) IsAliasExist(alias string) (bool, error)
- func (s ShortLinkSQL) UpdateOpenGraphTags(alias string, openGraphTags metatag.OpenGraph) (entity.ShortLink, error)
- func (s ShortLinkSQL) UpdateShortLink(oldAlias string, shortLinkInput entity.ShortLinkInput) (entity.ShortLink, error)
- func (s ShortLinkSQL) UpdateTwitterTags(alias string, twitterTags metatag.Twitter) (entity.ShortLink, error)
- type UserChangeLogSQL
- type UserRoleSQL
- type UserSQL
- type UserShortLinkSQL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeySQL ¶
type APIKeySQL struct {
// contains filtered or unexported fields
}
APIKeySQL accesses APIKey from the database through SQL.
func NewAPIKeySQL ¶
NewAPIKeySQL creates database access object for APIKey.
func (APIKeySQL) CreateAPIKey ¶
CreateAPIKey appends a new APIKey entry to APIKey table using SQL.
type AppSQL ¶
type AppSQL struct {
// contains filtered or unexported fields
}
AppSQL access third party app info through in SQL database.
type ChangeLogSQL ¶
type ChangeLogSQL struct {
// contains filtered or unexported fields
}
ChangeLogSQL accesses ChangeLog information in change_log table through SQL.
func NewChangeLogSQL ¶
func NewChangeLogSQL(db *sql.DB) ChangeLogSQL
NewChangeLogSQL creates ChangeLogSQL
func (ChangeLogSQL) CreateChange ¶
CreateChange adds a new Change into change_log table.
func (ChangeLogSQL) DeleteChange ¶
func (c ChangeLogSQL) DeleteChange(id string) error
DeleteChange removes a change with the given id
func (ChangeLogSQL) GetChangeLog ¶
func (c ChangeLogSQL) GetChangeLog() ([]entity.Change, error)
GetChangeLog retrieves full changelog from change_log table.
func (ChangeLogSQL) UpdateChange ¶
UpdateChange updates an existing change in change_log table.
type FacebookSSOSql ¶
type FacebookSSOSql struct {
// contains filtered or unexported fields
}
FacebookSSOSql accesses mapping between Facebook and Short accounts in SQL database.
func NewFacebookSSOSql ¶
func NewFacebookSSOSql(db *sql.DB, logger logger.Logger) FacebookSSOSql
NewFacebookSSOSql creates FacebookSSOSql.
func (FacebookSSOSql) CreateMapping ¶
func (g FacebookSSOSql) CreateMapping(ssoUserID string, userID string) error
CreateMapping creates links user's Facebook and Short accounts in the database.
func (FacebookSSOSql) GetShortUserID ¶
func (g FacebookSSOSql) GetShortUserID(ssoUserID string) (string, error)
GetShortUserID retrieves the internal user ID that is linked to the user's Facebook account.
func (FacebookSSOSql) IsSSOUserExist ¶
func (g FacebookSSOSql) IsSSOUserExist(ssoUserID string) (bool, error)
IsSSOUserExist checks whether mapping for a given Facebook account exists in the database.
type FeatureToggleSQL ¶
type FeatureToggleSQL struct {
// contains filtered or unexported fields
}
FeatureToggleSQL accesses feature toggle information in feature_toggle table through SQL.
func NewFeatureToggleSQL ¶
func NewFeatureToggleSQL(db *sql.DB) FeatureToggleSQL
NewFeatureToggleSQL create FeatureToggleSQL repository.
func (FeatureToggleSQL) FindToggleByID ¶
func (f FeatureToggleSQL) FindToggleByID(id string) (entity.Toggle, error)
FindToggleByID fetches feature toggle from the database given toggle id.
type GithubSSOSql ¶
type GithubSSOSql struct {
// contains filtered or unexported fields
}
GithubSSOSql accesses mapping between Github and Short accounts in the SQL database.
func NewGithubSSOSql ¶
func NewGithubSSOSql(db *sql.DB, logger logger.Logger) GithubSSOSql
NewGithubSSOSql creates GithubSSOSql.
func (GithubSSOSql) CreateMapping ¶
func (g GithubSSOSql) CreateMapping(ssoUserID string, userID string) error
CreateMapping links user's Github and Short accounts in the database.
func (GithubSSOSql) GetShortUserID ¶
func (g GithubSSOSql) GetShortUserID(ssoUserID string) (string, error)
GetShortUserID retrieves the internal user ID that is linked to the user's Github account.
func (GithubSSOSql) IsSSOUserExist ¶
func (g GithubSSOSql) IsSSOUserExist(ssoUserID string) (bool, error)
IsSSOUserExist checks whether mapping for a given Github account exists in the database.
type GoogleSSOSql ¶
type GoogleSSOSql struct {
// contains filtered or unexported fields
}
GoogleSSOSql accesses mapping between Google and Short accounts in the SQL database.
func NewGoogleSSOSql ¶
func NewGoogleSSOSql(db *sql.DB, logger logger.Logger) GoogleSSOSql
NewGoogleSSOSql creates GoogleSSOSql.
func (GoogleSSOSql) CreateMapping ¶
func (g GoogleSSOSql) CreateMapping(ssoUserID string, userID string) error
CreateMapping creates links user's Google and Short accounts in the database.
func (GoogleSSOSql) GetShortUserID ¶
func (g GoogleSSOSql) GetShortUserID(ssoUserID string) (string, error)
GetShortUserID retrieves the internal user ID that is linked to the user's Google account.
func (GoogleSSOSql) IsSSOUserExist ¶
func (g GoogleSSOSql) IsSSOUserExist(ssoUserID string) (bool, error)
IsSSOUserExist checks whether mapping for a given Google account exists in the database.
type ShortLinkSQL ¶
type ShortLinkSQL struct {
// contains filtered or unexported fields
}
ShortLinkSQL accesses ShortLink information in short_link table through SQL.
func NewShortLinkSQL ¶
func NewShortLinkSQL(db *sql.DB) ShortLinkSQL
NewShortLinkSQL creates ShortLinkSQL
func (ShortLinkSQL) CreateShortLink ¶
func (s ShortLinkSQL) CreateShortLink(shortLinkInput entity.ShortLinkInput) error
CreateShortLink inserts a new ShortLink into short_link table.
func (ShortLinkSQL) DeleteShortLink ¶
func (s ShortLinkSQL) DeleteShortLink(alias string) error
DeleteShortLink deletes an existing user short link.
func (ShortLinkSQL) GetShortLinkByAlias ¶
func (s ShortLinkSQL) GetShortLinkByAlias(alias string) (entity.ShortLink, error)
GetShortLinkByAlias finds an ShortLink in short_link table given alias.
func (ShortLinkSQL) GetShortLinksByAliases ¶
func (s ShortLinkSQL) GetShortLinksByAliases(aliases []string) ([]entity.ShortLink, error)
GetShortLinksByAliases finds ShortLinks for a list of aliases
func (ShortLinkSQL) IsAliasExist ¶
func (s ShortLinkSQL) IsAliasExist(alias string) (bool, error)
IsAliasExist checks whether a given alias exist in short_link table.
func (ShortLinkSQL) UpdateOpenGraphTags ¶
func (s ShortLinkSQL) UpdateOpenGraphTags(alias string, openGraphTags metatag.OpenGraph) (entity.ShortLink, error)
UpdateOpenGraphTags updates OpenGraph meta tags for a given short link.
func (ShortLinkSQL) UpdateShortLink ¶
func (s ShortLinkSQL) UpdateShortLink(oldAlias string, shortLinkInput entity.ShortLinkInput) (entity.ShortLink, error)
UpdateShortLink updates a ShortLink that exists within the short_link table.
func (ShortLinkSQL) UpdateTwitterTags ¶
func (s ShortLinkSQL) UpdateTwitterTags(alias string, twitterTags metatag.Twitter) (entity.ShortLink, error)
UpdateTwitterTags updates Twitter meta tags for a given short link.
type UserChangeLogSQL ¶
type UserChangeLogSQL struct {
// contains filtered or unexported fields
}
UserChangeLogSQL accesses UserChangeLog information in user_changelog table through SQL.
func NewUserChangeLogSQL ¶
func NewUserChangeLogSQL(db *sql.DB) UserChangeLogSQL
NewUserChangeLogSQL creates UserChangeLogSQL
func (UserChangeLogSQL) CreateRelation ¶
CreateRelation inserts a new entry into user_changelog table.
func (UserChangeLogSQL) GetLastViewedAt ¶
GetLastViewedAt retrieves LastViewedAt for a given user.
func (UserChangeLogSQL) UpdateLastViewedAt ¶
func (u UserChangeLogSQL) UpdateLastViewedAt(user entity.User, currentTime time.Time) (time.Time, error)
UpdateLastViewedAt updates LastViewedAt for the given user.
type UserRoleSQL ¶
type UserRoleSQL struct {
// contains filtered or unexported fields
}
UserRoleSQL accesses a user's role information in user_role table through SQL.
func NewUserRoleSQL ¶
func NewUserRoleSQL(db *sql.DB) UserRoleSQL
NewUserRoleSQL creates UserRoleSQL
func (UserRoleSQL) DeleteRole ¶
DeleteRole removes the given role from the user
type UserSQL ¶
type UserSQL struct {
// contains filtered or unexported fields
}
UserSQL accesses User information in user table through SQL.
func (UserSQL) CreateUser ¶
CreateUser inserts a new User into user table.
func (UserSQL) GetUserByEmail ¶
GetUserByEmail finds an User in user table given email.
func (UserSQL) GetUserByID ¶
GetUserByID finds an User in user table given user ID.
func (UserSQL) IsEmailExist ¶
IsEmailExist checks whether a given email exists in user table.
type UserShortLinkSQL ¶
type UserShortLinkSQL struct {
// contains filtered or unexported fields
}
UserShortLinkSQL accesses UserShortLink information in user_short_link table.
func NewUserShortLinkSQL ¶
func NewUserShortLinkSQL(db *sql.DB) UserShortLinkSQL
NewUserShortLinkSQL creates UserShortLinkSQL
func (UserShortLinkSQL) CreateRelation ¶
func (u UserShortLinkSQL) CreateRelation(user entity.User, shortLinkInput entity.ShortLinkInput) error
CreateRelation establishes bi-directional relationship between a user and a short link in user_short_link table.
func (UserShortLinkSQL) FindAliasesByUser ¶
func (u UserShortLinkSQL) FindAliasesByUser(user entity.User) ([]string, error)
FindAliasesByUser fetches the aliases of all the ShortLinks created by the given user. TODO(issue#260): allow API client to filter urls based on visibility.
func (UserShortLinkSQL) HasMapping ¶
HasMapping checks whether a given short link is tied to a user.