storage

package
v0.0.0-...-c5462c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package storage contains the logic to persist data in the DB

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB() error

CloseDB terminate the DB Session in a properly way

func DeleteMember

func DeleteMember(channelID, memberID string) error

DeleteMember deletes a member from a bucket which identifies the channel

func DeletePredefinedRepliesByChannel

func DeletePredefinedRepliesByChannel(channelID string) error

DeletePredefinedRepliesByChannel deletes all replies associated to answers in a Daily Meeting channel

func GetDailyMeetingsByBot

func GetDailyMeetingsByBot(botID string, teamDailyMeetings *[]api.DailyMeeting) error

GetDailyMeetingsByBot returns all the daily meeting configuration associated to a bot

func GetMemberByName

func GetMemberByName(channelID, memberName string) (member *api.Member, err error)

GetMemberByName returns member which is identified by a string, the name

func GetMembersByChannel

func GetMembersByChannel(channelID string, teamMembers *[]api.Member) error

GetMembersByChannel returns all members stored in a bucket

func GetPredefinedReplies

func GetPredefinedReplies(channelID string, replies *[]api.PredefinedDailyReply) error

GetPredefinedReplies returns all replies associated to answers in a Daily Meeting

func InitDB

func InitDB(path string) error

InitDB initializes the database, creating or opening the file

func StoreChannel

func StoreChannel(channelToBeCreated api.Channel) error

StoreChannel create a bucket by channel where data can be stored

func StoreDailyMeeting

func StoreDailyMeeting(daily api.DailyMeeting) error

StoreDailyMeeting persists the members and configuration of a Daily Meeting

func StoreMember

func StoreMember(member api.Member) error

StoreMember persists a member inside a bucket identifying the channel

func StorePredefinedReply

func StorePredefinedReply(reply api.PredefinedDailyReply) error

StorePredefinedReply saves a predefined reply used to reply to Daily Meeting answers

Types

type NotMemberFoundError

type NotMemberFoundError string

NotMemberFoundError is returned when member isn't stored in the database

func (NotMemberFoundError) Error

func (f NotMemberFoundError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL