diff options
| author | jackyzha0 <[email protected]> | 2020-05-09 12:55:48 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-05-09 12:55:48 -0700 |
| commit | a797d6f4798c8794dfe45fb745ecadd659ad77e5 (patch) | |
| tree | eedf0601b321c2536bf5c87777cc5bc7d67f2736 /db/db.go | |
| parent | working con to mongo (diff) | |
| download | ctrl-v-a797d6f4798c8794dfe45fb745ecadd659ad77e5.tar.xz ctrl-v-a797d6f4798c8794dfe45fb745ecadd659ad77e5.zip | |
outline insert op
Diffstat (limited to 'db/db.go')
| -rw-r--r-- | db/db.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 +} |