move channel type to own typings file

This commit is contained in:
lyx0 2021-10-28 18:04:05 +02:00
parent e494d817f8
commit 37d8296e40
2 changed files with 6 additions and 5 deletions

View file

@ -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
View file

@ -0,0 +1,6 @@
package db
type Channel struct {
Name string `bson:"name,omitempty"`
Connect bool `bson:"connect,omitempty"`
}