From a797d6f4798c8794dfe45fb745ecadd659ad77e5 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sat, 9 May 2020 12:55:48 -0700 Subject: outline insert op --- db/db.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'db/db.go') diff --git a/db/db.go b/db/db.go index c170af3..5c35495 100644 --- a/db/db.go +++ b/db/db.go @@ -20,3 +20,18 @@ func init() { initSessions(mUser, mPass, mIP) } + +// creates a new +func New(hash, content string) error { + + // create new struct + new := Paste{ + Hash: hash, + Content: content, + } + + // insert struct + log.Infof("create new paste with hash %s", hash) + insertErr := insert(new) + return insertErr +} -- cgit v1.2.3