Documentation ¶
Index ¶
- func CloseConnection(dbEngine ITransactionSQL)
- func ConvertJsonToQueryMap(dir string) error
- func CreateSQLTransaction(dbEngine ITransactionSQL, dbFunction func(tx *sql.Tx) error) error
- func Query(path string, input ...interface{}) (string, error)
- func WriteToDB(tx ITransaction, path string, input ...interface{}) (int64, error)
- type IColumnMatcher
- type ITransaction
- type ITransactionSQL
- type MysqlDatabaseAccess
- type Notification
- func (n *Notification) ColumnMatcher(column string) interface{}
- func (n *Notification) Get(tx ITransaction) error
- func (n *Notification) GetAllColumn() []interface{}
- func (n Notification) Insert(tx ITransaction) (int64, error)
- func (n Notification) InsertFormat() string
- func (n *Notification) Scan(rows RowsScan, selectRows []string) error
- type Notifications
- func (n Notifications) ComposeIdBulkFormat() string
- func (n Notifications) ComposeInputBulkFormat() string
- func (n Notifications) Delete(tx ITransaction) (int64, error)
- func (n *Notifications) Get(tx ITransaction, selectColumn []string, wherePairs [][]string) error
- func (n Notifications) Insert(tx ITransaction) (int64, error)
- func (n Notifications) InsertFormat() string
- func (n *Notifications) Scan(rows RowsScan, selectColumn []string) error
- func (n Notifications) UpdateReadNotification(tx ITransaction) (int64, error)
- type QueryMap
- type RowsScan
- type Subscriber
- func (s *Subscriber) ColumnMatcher(columnName string) interface{}
- func (s Subscriber) Delete(tx ITransaction) (int64, error)
- func (s Subscriber) DeleteFormat() string
- func (s *Subscriber) GetAllColumn() []interface{}
- func (s Subscriber) Insert(tx ITransaction) (int64, error)
- func (s Subscriber) InsertFormat() string
- type Subscribers
- type Topic
- func (t *Topic) ColumnMatcher(column string) interface{}
- func (t Topic) Delete(tx ITransaction) (int64, error)
- func (t *Topic) GetAllColumn() []interface{}
- func (t Topic) Insert(tx ITransaction) (int64, error)
- func (t Topic) InsertFormat() string
- func (t Topic) Update(tx ITransaction) (int64, error)
- func (t Topic) UpdateFormat() string
- type Topics
- type UserProfile
- func (up *UserProfile) ColumnMatcher(columnName string) interface{}
- func (up UserProfile) Delete(tx ITransaction) (int64, error)
- func (up UserProfile) DeleteFormat() string
- func (up *UserProfile) Find(tx ITransaction, selectColumn []string, wherePairs [][]string) error
- func (up *UserProfile) Get(tx ITransaction) error
- func (up *UserProfile) GetAllColumn() []interface{}
- func (up UserProfile) GetFilledKey() []string
- func (up UserProfile) Insert(tx ITransaction) (int64, error)
- func (up UserProfile) InsertFormat() string
- func (up *UserProfile) Scan(rows RowsScan, selectRows []string) error
- func (up UserProfile) ToStringJSON() string
- func (up UserProfile) Update(tx ITransaction, updateables []string) (int64, error)
- func (up UserProfile) UpdateFormat(updateables []string) string
- type UserProfiles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnection ¶
func CloseConnection(dbEngine ITransactionSQL)
func ConvertJsonToQueryMap ¶
func CreateSQLTransaction ¶
func CreateSQLTransaction(dbEngine ITransactionSQL, dbFunction func(tx *sql.Tx) error) error
Types ¶
type IColumnMatcher ¶
type IColumnMatcher interface { ColumnMatcher(columnName string) interface{} GetAllColumn() []interface{} }
type ITransaction ¶
type ITransactionSQL ¶
type MysqlDatabaseAccess ¶
type MysqlDatabaseAccess struct { Username string Password string Protocol string Address string DBName string }
func (MysqlDatabaseAccess) ConnectDatabase ¶
func (mda MysqlDatabaseAccess) ConnectDatabase() (ITransactionSQL, error)
type Notification ¶
type Notification struct { Id int `json:"id"` UserId string `json:"user_id"` TopicId int `json:"topic_id"` Message string `json:"message"` IsRead bool `json:"is_read"` }
-------- NOTIFICATION MODEL FUNCTION --------- //
func (*Notification) ColumnMatcher ¶
func (n *Notification) ColumnMatcher(column string) interface{}
func (*Notification) Get ¶
func (n *Notification) Get(tx ITransaction) error
func (*Notification) GetAllColumn ¶
func (n *Notification) GetAllColumn() []interface{}
func (Notification) Insert ¶
func (n Notification) Insert(tx ITransaction) (int64, error)
func (Notification) InsertFormat ¶
func (n Notification) InsertFormat() string
type Notifications ¶
type Notifications []Notification
func (Notifications) ComposeIdBulkFormat ¶
func (n Notifications) ComposeIdBulkFormat() string
func (Notifications) ComposeInputBulkFormat ¶
func (n Notifications) ComposeInputBulkFormat() string
func (Notifications) Delete ¶
func (n Notifications) Delete(tx ITransaction) (int64, error)
func (*Notifications) Get ¶
func (n *Notifications) Get(tx ITransaction, selectColumn []string, wherePairs [][]string) error
func (Notifications) Insert ¶
func (n Notifications) Insert(tx ITransaction) (int64, error)
func (Notifications) InsertFormat ¶
func (n Notifications) InsertFormat() string
func (*Notifications) Scan ¶
func (n *Notifications) Scan(rows RowsScan, selectColumn []string) error
func (Notifications) UpdateReadNotification ¶
func (n Notifications) UpdateReadNotification(tx ITransaction) (int64, error)
type RowsScan ¶
func ReadFromDB ¶
func ReadFromDB(tx ITransaction, path string, selectionInterface ...interface{}) (RowsScan, error)
*
Create an interface after path, currently can be inserted with selectColumn []string, whereColumn [][]string, afterWhere[][]string must be inserted in that order
type Subscriber ¶
type Subscriber struct { Id int `json:"id"` TopicId int `json:"topic_id"` UserId string `json:"user_id"` }
------- SUBSCRIBER MODEL FUNCTION --------- //
func (*Subscriber) ColumnMatcher ¶
func (s *Subscriber) ColumnMatcher(columnName string) interface{}
func (Subscriber) Delete ¶
func (s Subscriber) Delete(tx ITransaction) (int64, error)
func (Subscriber) DeleteFormat ¶
func (s Subscriber) DeleteFormat() string
func (*Subscriber) GetAllColumn ¶
func (s *Subscriber) GetAllColumn() []interface{}
func (Subscriber) Insert ¶
func (s Subscriber) Insert(tx ITransaction) (int64, error)
func (Subscriber) InsertFormat ¶
func (s Subscriber) InsertFormat() string
type Subscribers ¶
type Subscribers []Subscriber
func (*Subscribers) Get ¶
func (s *Subscribers) Get(tx ITransaction, selectColumn []string, wherePairs [][]string) error
type Topic ¶
type Topic struct { Id int `json:"id"` UserId string `json:"user_id"` Title string `json:"title"` Desc string `json:"description` }
------- TOPIC MODEL FUNCTION --------- //
func (*Topic) ColumnMatcher ¶
func (*Topic) GetAllColumn ¶
func (t *Topic) GetAllColumn() []interface{}
func (Topic) InsertFormat ¶
func (Topic) UpdateFormat ¶
type UserProfile ¶
type UserProfile struct { Email string `json:"email"` Id string `json:"id"` Password string `json:"password"` Token string `json:"token"` }
------- USER MODEL FUNCTION --------- //
func (*UserProfile) ColumnMatcher ¶
func (up *UserProfile) ColumnMatcher(columnName string) interface{}
func (UserProfile) Delete ¶
func (up UserProfile) Delete(tx ITransaction) (int64, error)
func (UserProfile) DeleteFormat ¶
func (up UserProfile) DeleteFormat() string
func (*UserProfile) Find ¶
func (up *UserProfile) Find(tx ITransaction, selectColumn []string, wherePairs [][]string) error
func (*UserProfile) Get ¶
func (up *UserProfile) Get(tx ITransaction) error
func (*UserProfile) GetAllColumn ¶
func (up *UserProfile) GetAllColumn() []interface{}
func (UserProfile) GetFilledKey ¶
func (up UserProfile) GetFilledKey() []string
func (UserProfile) Insert ¶
func (up UserProfile) Insert(tx ITransaction) (int64, error)
func (UserProfile) InsertFormat ¶
func (up UserProfile) InsertFormat() string
func (UserProfile) ToStringJSON ¶
func (up UserProfile) ToStringJSON() string
func (UserProfile) Update ¶
func (up UserProfile) Update(tx ITransaction, updateables []string) (int64, error)
func (UserProfile) UpdateFormat ¶
func (up UserProfile) UpdateFormat(updateables []string) string
type UserProfiles ¶
type UserProfiles []UserProfile
func (UserProfiles) BulkDelete ¶
func (up UserProfiles) BulkDelete(tx ITransaction) error
func (UserProfiles) BulkInsert ¶
func (up UserProfiles) BulkInsert(tx ITransaction) (int64, error)
Click to show internal directories.
Click to hide internal directories.