-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df74868
commit b7b9961
Showing
8 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package botsfw | ||
|
||
import "context" | ||
|
||
// BotChatStore is interface for DAL to store bot chat data | ||
type BotChatStore interface { | ||
GetBotChatEntityByID(c context.Context, botID, botChatID string) (BotChat, error) | ||
SaveBotChat(c context.Context, botID, botChatID string, chatEntity BotChat) error | ||
NewBotChatEntity(c context.Context, botID string, botChat WebhookChat, appUserID, botUserID string, isAccessGranted bool) BotChat | ||
Close(c context.Context) error // TODO: Was io.Closer, should it? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
package botsfw | ||
|
||
import ( | ||
"context" | ||
"github.com/strongo/app/user" | ||
) | ||
|
||
// BotUser interface provides information about bot user | ||
type BotUser interface { | ||
GetAppUserIntID() int64 | ||
// GetAppUserIntID returns app user ID | ||
// Deprecated: use GetAppUserStrID instead | ||
GetAppUserIntID() int64 // TODO: decommission? | ||
GetAppUserStrID() string | ||
IsAccessGranted() bool | ||
SetAccessGranted(value bool) bool | ||
SetAppUserIntID(appUserID int64) | ||
user.UpdatedTimeSetter | ||
} | ||
|
||
// BotUserStore provider to store information about bot user | ||
type BotUserStore interface { | ||
GetBotUserByID(c context.Context, botUserID interface{}) (BotUser, error) | ||
SaveBotUser(c context.Context, botUserID interface{}, botUserEntity BotUser) error | ||
CreateBotUser(c context.Context, botID string, apiUser WebhookActor) (BotUser, error) | ||
//io.Closer | ||
user.UpdatedTimeSetter // SetUpdatedTime(time.Time) // to satisfy github.com/strongo/app/user.UpdatedTimeSetter | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package botsfw | ||
|
||
import "context" | ||
|
||
//type UserID interface { | ||
// int | string | ||
//} | ||
|
||
// BotUserStore provider to store information about bot user | ||
type BotUserStore interface { | ||
|
||
// GetBotUserByID returns bot user data | ||
GetBotUserByID(c context.Context, botUserID any) (BotUser, error) | ||
|
||
// SaveBotUser saves bot user data | ||
SaveBotUser(c context.Context, botUserID any, botUserData BotUser) error | ||
|
||
// CreateBotUser creates new bot user in DB | ||
// Deprecated: should be moved to bots-fw-* package | ||
CreateBotUser(c context.Context, botID string, apiUser WebhookActor) (BotUser, error) | ||
//io.Closer | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package botsfwframework | ||
package botsframework | ||
|
||
// Main code for the package is in the `botsfw` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package botsframework | ||
|
||
import "testing" | ||
|
||
func TestPackage(t *testing.T) { | ||
t.Log("Package test") | ||
} |