mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
move channel type to own typings file
This commit is contained in:
parent
e494d817f8
commit
37d8296e40
2 changed files with 6 additions and 5 deletions
|
@ -11,11 +11,6 @@ import (
|
||||||
"go.mongodb.org/mongo-driver/mongo/options"
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Channel struct {
|
|
||||||
Name string `bson:"name,omitempty"`
|
|
||||||
Connect bool `bson:"connect,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func Connect(cfg *config.Config) *mongo.Client {
|
func Connect(cfg *config.Config) *mongo.Client {
|
||||||
client, err := mongo.NewClient(options.Client().ApplyURI(cfg.MongoURI))
|
client, err := mongo.NewClient(options.Client().ApplyURI(cfg.MongoURI))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
6
pkg/db/typings.go
Normal file
6
pkg/db/typings.go
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package db
|
||||||
|
|
||||||
|
type Channel struct {
|
||||||
|
Name string `bson:"name,omitempty"`
|
||||||
|
Connect bool `bson:"connect,omitempty"`
|
||||||
|
}
|
Loading…
Reference in a new issue