Documentation ¶
Index ¶
- Variables
- func GetSQL(dbType string, queryTag string) string
- type DataStore
- func (s *DataStore) Add(r routes.Route) (int, error)
- func (s *DataStore) Delete(k string) error
- func (s *DataStore) DumpAllRoutes() ([]routes.Route, error)
- func (s *DataStore) Get(k string) (routes.Route, error)
- func (s *DataStore) GetAllUsers() error
- func (s *DataStore) GetRandomURL(k string) (routes.Route, error)
- func (s *DataStore) GetURL(k string) (string, error)
- func (s *DataStore) GetUser(username string) (*User, error)
- func (s *DataStore) IsSQLErrDuplicateContraint(err error) bool
- func (s *DataStore) IsSQLErrUniqueContraint(err error) bool
- func (s *DataStore) Lock(r routes.Route) (int, error)
- func (s *DataStore) MakeAdmin(username string, admin string) (int, error)
- func (s *DataStore) Modify(r routes.Route) (int, error)
- type RouteStore
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var SQLDict map[string]map[string]string
Functions ¶
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
Store is the data structure wrapping the underlying database interactions. It contains the handle to the database, i.e. the database handle representing a pool of zero or more underlying connections.
func GetStore ¶
func GetStore(dbtype string, dbConn *sql.DB, redisClient *redis.Client, redisTTL int) (*DataStore, error)
GetStore is the constructor for the Store struct and does the actual work of creating the DB handler.
func (*DataStore) GetAllUsers ¶
func (*DataStore) GetURL ¶
GetURL is the main entry point for the app. It is the shortlink. The other getters are designed for potentially slower access via an editor tool.
func (*DataStore) IsSQLErrDuplicateContraint ¶
func (*DataStore) IsSQLErrUniqueContraint ¶
type RouteStore ¶
Click to show internal directories.
Click to hide internal directories.