75 lines
1.5 KiB
Go
Raw Normal View History

2019-06-03 09:32:43 +00:00
package arn
import (
2019-09-08 23:46:43 +00:00
"path"
2019-06-03 09:32:43 +00:00
"github.com/aerogo/api"
"github.com/aerogo/nano"
"github.com/animenotifier/kitsu"
"github.com/animenotifier/mal"
)
// Node represents the database node.
var Node = nano.New(nano.Configuration{
2019-09-08 23:46:43 +00:00
Port: 5000,
Directory: path.Join(Root, "db"),
2019-06-03 09:32:43 +00:00
})
// DB is the main database client.
var DB = Node.Namespace("arn").RegisterTypes(
(*ActivityCreate)(nil),
(*ActivityConsumeAnime)(nil),
(*AMV)(nil),
(*Analytics)(nil),
(*Anime)(nil),
(*AnimeCharacters)(nil),
(*AnimeRelations)(nil),
(*AnimeList)(nil),
2019-11-04 07:34:00 +00:00
(*Crash)(nil),
2019-06-03 09:32:43 +00:00
(*Character)(nil),
(*ClientErrorReport)(nil),
(*Company)(nil),
(*DraftIndex)(nil),
(*EditLogEntry)(nil),
(*EmailToUser)(nil),
2019-08-28 08:06:42 +00:00
(*Episode)(nil),
2019-06-03 09:32:43 +00:00
(*FacebookToUser)(nil),
(*GoogleToUser)(nil),
(*Group)(nil),
(*IDList)(nil),
(*IgnoreAnimeDifference)(nil),
(*Inventory)(nil),
(*NickToUser)(nil),
(*Notification)(nil),
(*PayPalPayment)(nil),
(*Person)(nil),
(*Post)(nil),
(*Purchase)(nil),
(*PushSubscriptions)(nil),
(*Quote)(nil),
(*Session)(nil),
(*Settings)(nil),
(*ShopItem)(nil),
(*SoundTrack)(nil),
(*Thread)(nil),
(*TwitterToUser)(nil),
(*User)(nil),
(*UserNotifications)(nil),
)
// MAL is the client for the MyAnimeList database.
var MAL = Node.Namespace("mal").RegisterTypes(
(*mal.Anime)(nil),
(*mal.Character)(nil),
)
// Kitsu is the client for the Kitsu database.
var Kitsu = Node.Namespace("kitsu").RegisterTypes(
(*kitsu.Anime)(nil),
(*kitsu.Mapping)(nil),
(*kitsu.Character)(nil),
)
2019-09-08 23:46:43 +00:00
// API is used to install the REST API.
2019-06-03 09:32:43 +00:00
var API = api.New("/api/", DB)