From 81e8bca78727e4a0615075ab4d8574ab5bc1278a Mon Sep 17 00:00:00 2001 From: zomo Date: Mon, 5 Jan 2026 23:23:13 -0600 Subject: [PATCH] moved auth structs --- ttv/auth.go | 20 ++++++++++++++++++++ ttv/main.go | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ttv/auth.go b/ttv/auth.go index 724558f..578c574 100644 --- a/ttv/auth.go +++ b/ttv/auth.go @@ -32,6 +32,26 @@ type TwitchAuth struct { Client *api.Client } +type TwitchAuthRespOk struct { + Code string `json:"code"` + Scope string `json:"scope"` + State string `json:"state"` +} + +type TwitchAuthRespErr struct { + Err string `json:"error"` + ErrDesc string `json:"error_description"` + State string `json:"state"` +} + +type TwitchAuthTokenResp struct { + AccessToken string `json:"access_token"` + ExpiresIn int `json:"expires_in"` + RefreshToken string `json:"refresh_token"` + Scope []string `json:"scope"` + TokenType string `json:"token_type"` +} + func (twitch *TwitchAuth) doAuth(formData url.Values) (TwitchAuthTokenResp, error) { resp, err := http.PostForm(TWITCH_AUTH_URL, formData) if err != nil { diff --git a/ttv/main.go b/ttv/main.go index 3115ad0..48f8591 100644 --- a/ttv/main.go +++ b/ttv/main.go @@ -17,23 +17,3 @@ func InitTwitchConn(conf *util.Config, dbConn *db.DBConn) (*TwitchConn, error) { type TwitchConn struct { Auth *TwitchAuth } - -type TwitchAuthRespOk struct { - Code string `json:"code"` - Scope string `json:"scope"` - State string `json:"state"` -} - -type TwitchAuthRespErr struct { - Err string `json:"error"` - ErrDesc string `json:"error_description"` - State string `json:"state"` -} - -type TwitchAuthTokenResp struct { - AccessToken string `json:"access_token"` - ExpiresIn int `json:"expires_in"` - RefreshToken string `json:"refresh_token"` - Scope []string `json:"scope"` - TokenType string `json:"token_type"` -}