Documentation
¶
Index ¶
- Variables
- func CheckControl(target string, platform string)
- func CountSQL(sqlStatement string) (id int64)
- func GetJsonByArticleId(articleId string) (reply conf.Reply)
- func GetJsonByContent(searchStr string, limit int, topic string) (reply conf.Reply)
- func GetJsonByTitle(search string, limit int, topic string) (reply conf.Reply)
- func GetLastJsonByFilter(limit int, filter string, topic string) (reply conf.Reply)
- func GetLastSingleJsonArticle(topic string, limit int) (reply conf.Reply)
- func GetLatestJsonArticle(callerId string, limit int, next bool, platform string, topic string) (reply conf.Reply)
- func GetListOfTargets(platform string) (aList []string)
- func GetNextArticle(callerId string, platform string, topic string) (message string, Behind int)
- func GetNextArticleByKeyWords(callerId string, keyword string, platform string, topic string) (message string)
- func GetNextJsonByArticleId(articleId string, limit int, filter string, topic string) (reply conf.Reply)
- func GetPrevJsonByArticleId(articleId string, limit int, filter string, topic string) (reply conf.Reply)
- func InitDB()
- func InsertArticle(topic string, title string, content string, name string, email string, ...) (id int64, returnErr error)
- func LoadAccounts()
- func RunSQL(sqlStatement string) (id int64)
- type AccountsStruct
- type Article
- type ArticleDetail
- type HomeMadeArticle
Constants ¶
This section is empty.
Variables ¶
var (
Accounts map[string]AccountsStruct
)
Functions ¶
func CheckControl ¶
********************************************************************************
- _ _ _____ _ _
- | | | | / ____| | | | |
- ___| |__ ___ ___| | _| | ___ _ __ | |_ _ __ ___ | |
- / __| '_ \ / _ \/ __| |/ / | / _ \| '_ \| __| '__/ _ \| |
- | (__| | | | __/ (__| <| |___| (_) | | | | |_| | | (_) | |
- \___|_| |_|\___|\___|_|\_\\_____\___/|_| |_|\__|_| \___/|_|
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- get the last article in the database.
- -----------------------------------------------------------------------------
func CountSQL ¶
********countSQL*******************************************************************
- _ _____ ____ _
- | | / ____|/ __ \| |
- ___ ___ _ _ _ __ | |_| (___ | | | | |
- / __/ _ \| | | | '_ \| __|\___ \| | | | |
- | (_| (_) | |_| | | | | |_ ____) | |__| | |____
- \___\___/ \__,_|_| |_|\__|_____/ \___\_\______|
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Count records based on the SQL request.
- ------------------------------------------------------------------------
func GetJsonByArticleId ¶
****************************************************************************************************
- _ _ ____ _____ _
- | | | | | _ \ |_ _| | |
- __ _ ___| |_ | |___ ___ _ __ | |_) |_ _ | | __| |
- / _` |/ _ \ __| | / __|/ _ \| '_ \| _ <| | | | | | / _` |
- | (_| | __/ || |__| \__ \ (_) | | | | |_) | |_| |_| || (_| |
- \__, |\___|\__\____/|___/\___/|_| |_|____/ \__, |_____\__,_|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- ------------------------------------------------------------------------------------------------
func GetJsonByContent ¶
****************************************************************************************************
- _ _ ____ _____ _ _
- | | | | | _ \ / ____| | | | |
- __ _ ___| |_ | |___ ___ _ __ | |_) |_ _| | ___ _ __ | |_ ___ _ __ | |_
- / _` |/ _ \ __| | / __|/ _ \| '_ \| _ <| | | | | / _ \| '_ \| __/ _ \ '_ \| __|
- | (_| | __/ || |__| \__ \ (_) | | | | |_) | |_| | |___| (_) | | | | || __/ | | | |_
- \__, |\___|\__\____/|___/\___/|_| |_|____/ \__, |\_____\___/|_| |_|\__\___|_| |_|\__|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- ------------------------------------------------------------------------------------------------
func GetJsonByTitle ¶
****************************************************************************************************
- _ _ ____ _______ _ _ _
- | | | | | _ \ |__ __(_) | | |
- __ _ ___| |_ | |___ ___ _ __ | |_) |_ _| | _| |_| | ___
- / _` |/ _ \ __| | / __|/ _ \| '_ \| _ <| | | | | | | __| |/ _ \
- | (_| | __/ || |__| \__ \ (_) | | | | |_) | |_| | | | | |_| | __/
- \__, |\___|\__\____/|___/\___/|_| |_|____/ \__, |_| |_|\__|_|\___|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- ------------------------------------------------------------------------------------------------
func GetLastJsonByFilter ¶
****************************************************************************************************
- _ _ _ _ ____ ______ _ _ _
- | | | | | | | | | _ \ | ____(_) | |
- __ _ ___| |_| | __ _ ___| |_ | |___ ___ _ __ | |_) |_ _| |__ _| | |_ ___ _ __
- / _` |/ _ \ __| | / _` / __| __| | / __|/ _ \| '_ \| _ <| | | | __| | | | __/ _ \ '__|
- | (_| | __/ |_| |___| (_| \__ \ || |__| \__ \ (_) | | | | |_) | |_| | | | | | || __/ |
- \__, |\___|\__|______\__,_|___/\__\____/|___/\___/|_| |_|____/ \__, |_| |_|_|\__\___|_|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- ------------------------------------------------------------------------------------------------
func GetLastSingleJsonArticle ¶
********************************************************************************
- _ _ _ _ _ _
- | | | | | | /\ | | (_) | |
- __ _ ___| |_| | __ _ ___| |_ / \ _ __| |_ _ ___| | ___
- / _` |/ _ \ __| | / _` / __| __| / /\ \ | '__| __| |/ __| |/ _ \
- | (_| | __/ |_| |___| (_| \__ \ |_ / ____ \| | | |_| | (__| | __/
- \__, |\___|\__|______\__,_|___/\__/_/ \_\_| \__|_|\___|_|\___|
- __/ |
- |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- get the last article in the database.
- -----------------------------------------------------------------------------
func GetLatestJsonArticle ¶
func GetLatestJsonArticle(callerId string, limit int, next bool, platform string, topic string) (reply conf.Reply)
****************************************************************************************************
- _ _ _ _ _ _ _ _
- | | | \ | | | | | | /\ | | (_) | |
- __ _ ___| |_| \| | _____ _| |_ | |___ ___ _ __ / \ _ __| |_ _ ___| | ___
- / _` |/ _ \ __| . ` |/ _ \ \/ / __| | / __|/ _ \| '_ \ / /\ \ | '__| __| |/ __| |/ _ \
- | (_| | __/ |_| |\ | __/> <| || |__| \__ \ (_) | | | |/ ____ \| | | |_| | (__| | __/
- \__, |\___|\__|_| \_|\___/_/\_\\__\____/|___/\___/|_| |_/_/ \_\_| \__|_|\___|_|\___|
- __/ |
- |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- ------------------------------------------------------------------------------------------------
func GetListOfTargets ¶
TODO check this function
func GetNextArticle ¶
******************************************************************************
- _ _ _ _ _ _ _
- | | | \ | | | | /\ | | (_) | |
- __ _ ___| |_| \| | _____ _| |_ / \ _ __| |_ _ ___| | ___
- / _` |/ _ \ __| . ` |/ _ \ \/ / __| / /\ \ | '__| __| |/ __| |/ _ \
- | (_| | __/ |_| |\ | __/> <| |_ / ____ \| | | |_| | (__| | __/
- \__, |\___|\__|_| \_|\___/_/\_\\__/_/ \_\_| \__|_|\___|_|\___|
- __/ |
- |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID from the control
- ----------------------------------------------------------------------------
func GetNextArticleByKeyWords ¶
func GetNextArticleByKeyWords(callerId string, keyword string, platform string, topic string) (message string)
******************************************************************************
- _ _ _ _ _ _ _ ____ _ __
- | | | \ | | | | /\ | | (_) | | | _ \ | |/ /
- __ _ ___| |_| \| | _____ _| |_ / \ _ __| |_ _ ___| | ___| |_) |_ _| ' / ___ _ _
- / _` |/ _ \ __| . ` |/ _ \ \/ / __| / /\ \ | '__| __| |/ __| |/ _ \ _ <| | | | < / _ \ | | |
- | (_| | __/ |_| |\ | __/> <| |_ / ____ \| | | |_| | (__| | __/ |_) | |_| | . \ __/ |_| |
- \__, |\___|\__|_| \_|\___/_/\_\\__/_/ \_\_| \__|_|\___|_|\___|____/ \__, |_|\_\___|\__, |
- __/ | __/ | __/ |
- |___/ |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID from the control
- ----------------------------------------------------------------------------
func GetNextJsonByArticleId ¶
func GetNextJsonByArticleId(articleId string, limit int, filter string, topic string) (reply conf.Reply)
**********************************************************************************************************************
- _ _ _ _ _ ____ _ _ _ _____ _
- | | | \ | | | | | | | _ \ /\ | | (_) | | |_ _| | |
- __ _ ___| |_| \| | _____ _| |_ | |___ ___ _ __ | |_) |_ _ / \ _ __| |_ _ ___| | ___ | | __| |
- / _` |/ _ \ __| . ` |/ _ \ \/ / __| | / __|/ _ \| '_ \| _ <| | | | / /\ \ | '__| __| |/ __| |/ _ \ | | / _` |
- | (_| | __/ |_| |\ | __/> <| || |__| \__ \ (_) | | | | |_) | |_| |/ ____ \| | | |_| | (__| | __/_| || (_| |
- \__, |\___|\__|_| \_|\___/_/\_\\__\____/|___/\___/|_| |_|____/ \__, /_/ \_\_| \__|_|\___|_|\___|_____\__,_|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- -------------------------------------------------------------------------------------------------------------------
func GetPrevJsonByArticleId ¶
func GetPrevJsonByArticleId(articleId string, limit int, filter string, topic string) (reply conf.Reply)
***********************************************************************************************************************
- _ _____ _ ____ _ _ _ _____ _
- | | | __ \ | | | _ \ /\ | | (_) | | |_ _| | |
- __ _ ___| |_| |__) | __ _____ __ | |___ ___ _ __ | |_) |_ _ / \ _ __| |_ _ ___| | ___ | | __| |
- / _` |/ _ \ __| ___/ '__/ _ \ \ / / | / __|/ _ \| '_ \| _ <| | | | / /\ \ | '__| __| |/ __| |/ _ \ | | / _` |
- | (_| | __/ |_| | | | | __/\ V / |__| \__ \ (_) | | | | |_) | |_| |/ ____ \| | | |_| | (__| | __/_| || (_| |
- \__, |\___|\__|_| |_| \___| \_/ \____/|___/\___/|_| |_|____/ \__, /_/ \_\_| \__|_|\___|_|\___|_____\__,_|
- __/ | __/ |
- |___/ |___/
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Gets the next article depending on the last Article ID and return as a json object
- -------------------------------------------------------------------------------------------------------------------
func InsertArticle ¶
func InsertArticle(topic string, title string, content string, name string, email string, cat string, link string, image string) (id int64, returnErr error)
******************************************************************
- _ _ _ _ _
- (_) | | /\ | | (_) | |
- _ _ __ ___ ___ _ __| |_ / \ _ __| |_ _ ___| | ___
- | | '_ \/ __|/ _ \ '__| __| / /\ \ | '__| __| |/ __| |/ _ \
- | | | | \__ \ __/ | | |_ / ____ \| | | |_| | (__| | __/
- |_|_| |_|___/\___|_| \__/_/ \_\_| \__|_|\___|_|\___|
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Inserts new articles into the datase, Rejects duplicates
- ----------------------------------------------------------------
func RunSQL ¶
***************************************************************************
- _ _____ _ _ _
- | |/ ____| | | | | |
- ___ __ _| | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_
- / __|/ _` | |\___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __|
- \__ \ (_| | |____) | || (_| | || __/ | | | | | __/ | | | |_
- |___/\__, |_|_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|
- | |
- |_|
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Run an SQL statement such as an insert.
- ------------------------------------------------------------------------
Types ¶
type AccountsStruct ¶
type Article ¶
type Article struct { Uid int64 `json:"uid"` Title string `json:"title"` Content string `json:"desc"` Author string `json:"author"` Email string `json:"email"` Topic string `json:"topic"` Cat string `json:"cat"` Link string `json:"link"` Detail ArticleDetail `json:"detail"` Rating int64 `json:"rating"` Created time.Time `json:"created"` }
type ArticleDetail ¶
type ArticleDetail map[string]interface{}
func (*ArticleDetail) Scan ¶
func (a *ArticleDetail) Scan(value interface{}) error