mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
chore: remove unused go code
This commit is contained in:
parent
0b384bfe5c
commit
9c935f2847
8 changed files with 1 additions and 110 deletions
|
@ -1,20 +0,0 @@
|
|||
package types
|
||||
|
||||
type DiscordUser struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
Discriminator string `json:"discriminator,omitempty"`
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
Bot bool `json:"bot,omitempty"`
|
||||
}
|
||||
|
||||
type Member struct {
|
||||
GuildID string `json:"guildid,omitempty"`
|
||||
Roles []string `json:"rolesList,omitempty"`
|
||||
Nick string `json:"nick,omitempty"`
|
||||
User DiscordUser `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
type RoleypolyUser struct {
|
||||
DiscordUser DiscordUser `json:"discorduser,omitempty"`
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
// CreateSessionRequest is the payload to /create-session
|
||||
type CreateSessionRequest struct {
|
||||
AccessTokenResponse AccessTokenResponse
|
||||
Fingerprint Fingerprint
|
||||
}
|
||||
|
||||
type Fingerprint struct {
|
||||
UserAgent string
|
||||
ClientIP string
|
||||
ForwardedFor string
|
||||
}
|
||||
|
||||
type CreateSessionResponse struct {
|
||||
SessionID string
|
||||
}
|
||||
|
||||
type SessionData struct {
|
||||
SessionID string
|
||||
Fingerprint Fingerprint
|
||||
AccessTokens AccessTokenResponse
|
||||
UserData UserData
|
||||
}
|
||||
|
||||
type UserData struct {
|
||||
DataExpires time.Time
|
||||
UserID string
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package types
|
||||
|
||||
// AccessTokenResponse is the response for Discord's OAuth token grant flow
|
||||
type AccessTokenResponse struct {
|
||||
AccessToken string `json:"access_token"`
|
||||
TokenType string `json:"token_type"`
|
||||
ExpiresIn int `json:"expires_in"`
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
Scope string `json:"scope"`
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package featureflags
|
|
@ -1,7 +0,0 @@
|
|||
load("//hack/bazel/js:react.bzl", "react_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
react_library(
|
||||
name = "react",
|
||||
)
|
|
@ -1,21 +0,0 @@
|
|||
package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
GitCommit = "unknown"
|
||||
GitBranch = "unknown"
|
||||
BuildDate = "unknown"
|
||||
)
|
||||
|
||||
func StartupInfo(serviceName string) string {
|
||||
return fmt.Sprintf(
|
||||
"Starting %s service.\n Build %s (%s) at %s",
|
||||
serviceName,
|
||||
GitCommit,
|
||||
GitBranch,
|
||||
BuildDate,
|
||||
)
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package version
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestStartup(t *testing.T) {
|
||||
GitBranch = "test"
|
||||
GitCommit = "e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e"
|
||||
BuildDate = time.Now().UTC().Format("2006-01-02T15:04:05.000Z")
|
||||
|
||||
expected := "Starting test service.\n Build e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e (test) at " + BuildDate
|
||||
value := StartupInfo("test")
|
||||
if value != expected {
|
||||
t.Error("Incorrect render, got `", value, "`")
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import (
|
|||
_ "github.com/joho/godotenv/autoload"
|
||||
"github.com/roleypoly/roleypoly/src/common"
|
||||
"github.com/roleypoly/roleypoly/src/common/bot"
|
||||
"github.com/roleypoly/roleypoly/src/common/version"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
|
@ -19,7 +18,7 @@ var (
|
|||
)
|
||||
|
||||
func main() {
|
||||
klog.Info(version.StartupInfo("discord-bot"))
|
||||
klog.Info("bot started")
|
||||
|
||||
err := bot.ScaffoldBot(bot.BotScaffolding{
|
||||
RootUsers: rootUsers,
|
||||
|
|
Loading…
Add table
Reference in a new issue