├── .gitignore ├── Makefile ├── Procfile ├── README.md ├── database ├── init.sql ├── post.go ├── postgres.go └── user.go ├── go.mod ├── go.sum ├── internal ├── auth │ ├── discord.go │ ├── github.go │ └── google.go └── template.go ├── main.go ├── middleware ├── auth.go └── error.go ├── models ├── post.go └── user.go ├── routes ├── auth.go ├── feed.go ├── post.go ├── search.go ├── user.go └── verify.go ├── static ├── images │ ├── avatar.jpg │ ├── icon.png │ └── tsuki.ico ├── loadMore.js ├── searchBar.js ├── styles.css └── utils.js └── templates ├── auth.tmpl.html ├── base.tmpl.html ├── delete.tmpl.html ├── error.tmpl.html ├── feed.tmpl.html ├── getPost.tmpl.html ├── index.tmpl.html ├── makePost.tmpl.html ├── response.tmpl.html ├── search.tmpl.html ├── update.tmpl.html ├── user.tmpl.html └── userPosts.tmpl.html /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | bin/ 3 | .air.toml 4 | tmp -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | go build -o bin/tsuki-go -v . 3 | ./bin/tsuki-go 4 | 5 | git: 6 | git add . 7 | git commit -m "$(msg)" 8 | git push 9 | git push heroku 10 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bin/tsuki-go 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tsuki 2 | Tsuki is a minimalistic open-sourced social media platform, built using Go. 3 | 4 | ## Running on local machine 5 | 6 | ### Requirements 7 | - Tsuki requires a `PostgreSQL` database to store all the data. 8 | - It uses the `Gmail API` for sending verification mail ([Reference](https://developers.google.com/gmail/api/quickstart/python)) and the `Freeimage API` for storing pictures ([Reference](https://freeimage.host/page/api)). 9 | - It also requires some environment variables to be declared in the `.env` file. The variables can be found in `example.env` 10 | 11 | ### Installation 12 | ``` 13 | go mod download 14 | ``` 15 | 16 | ### Building and Running 17 | ``` 18 | go build . 19 | ./tsuki-go 20 | ``` 21 | -------------------------------------------------------------------------------- /database/init.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS t_users ( 2 | email VARCHAR(320) UNIQUE NOT NULL, 3 | username VARCHAR(32) PRIMARY KEY, 4 | password VARCHAR(64) NOT NULL, 5 | id CHAR(36) UNIQUE NOT NULL, 6 | verified BOOL NOT NULL, 7 | avatar TEXT, 8 | created_at TIMESTAMPTZ NOT NULL 9 | ); 10 | 11 | CREATE TABLE IF NOT EXISTS o_users ( 12 | id CHAR(36) PRIMARY KEY, 13 | CONSTRAINT fk_id 14 | FOREIGN KEY(id) 15 | REFERENCES t_users(id) 16 | ON DELETE CASCADE 17 | ); 18 | 19 | CREATE TABLE IF NOT EXISTS shorturl ( 20 | token VARCHAR(320) PRIMARY KEY, 21 | id CHAR(36) UNIQUE NOT NULL 22 | ); 23 | 24 | CREATE TABLE IF NOT EXISTS posts ( 25 | user_id CHAR(36) NOT NULL, 26 | id CHAR(36) PRIMARY KEY, 27 | body VARCHAR(320) NOT NULL, 28 | created_at TIMESTAMPTZ NOT NULL, 29 | CONSTRAINT fk_user_id 30 | FOREIGN KEY(user_id) 31 | REFERENCES t_users(id) 32 | ON DELETE CASCADE 33 | ); 34 | 35 | CREATE TABLE IF NOT EXISTS follows ( 36 | user_id CHAR(36) NOT NULL, 37 | follow_id CHAR(36) NOT NULL, 38 | CONSTRAINT fk_user_id 39 | FOREIGN KEY(user_id) 40 | REFERENCES t_users(id) 41 | ON DELETE CASCADE, 42 | CONSTRAINT fk_follow_id 43 | FOREIGN KEY(follow_id) 44 | REFERENCES t_users(id) 45 | ON DELETE CASCADE 46 | ); 47 | 48 | CREATE TABLE IF NOT EXISTS votes ( 49 | user_id CHAR(36) NOT NULL, 50 | id CHAR(36) NOT NULL, 51 | CONSTRAINT fk_id 52 | FOREIGN KEY(id) 53 | REFERENCES posts(id) 54 | ON DELETE CASCADE, 55 | CONSTRAINT fk_user_id 56 | FOREIGN KEY(user_id) 57 | REFERENCES t_users(id) 58 | ON DELETE CASCADE 59 | ); 60 | 61 | CREATE TABLE IF NOT EXISTS comments ( 62 | user_id CHAR(36) NOT NULL, 63 | post_id CHAR(36) NOT NULL, 64 | id CHAR(36) PRIMARY KEY, 65 | body VARCHAR(320) NOT NULL, 66 | created_at TIMESTAMPTZ NOT NULL, 67 | CONSTRAINT fk_post_id 68 | FOREIGN KEY(post_id) 69 | REFERENCES posts(id) 70 | ON DELETE CASCADE, 71 | CONSTRAINT fk_user_id 72 | FOREIGN KEY(user_id) 73 | REFERENCES t_users(id) 74 | ON DELETE CASCADE 75 | ); -------------------------------------------------------------------------------- /database/post.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/Devansh3712/tsuki-go/models" 7 | ) 8 | 9 | func CreatePost(userId string, post *models.Post) bool { 10 | if _, err := db.Exec( 11 | `INSERT INTO posts(user_id, id, body, created_at) 12 | VALUES ($1, $2, $3, $4)`, 13 | userId, post.Id, post.Body, post.CreatedAt, 14 | ); err != nil { 15 | log.Println(err) 16 | return false 17 | } 18 | return true 19 | } 20 | 21 | func ReadPost(id string) *models.Post { 22 | var post models.Post 23 | if err := db.QueryRow(`SELECT * FROM posts WHERE id = $1`, id).Scan( 24 | &post.UserId, &post.Id, &post.Body, &post.CreatedAt, 25 | ); err != nil { 26 | log.Println(err) 27 | return nil 28 | } 29 | return &post 30 | } 31 | 32 | func ReadPostsCount(userId string) int { 33 | var count int 34 | if err := db.QueryRow(`SELECT COUNT(*) FROM posts WHERE user_id = $1`, userId).Scan(&count); err != nil { 35 | log.Println(err) 36 | return 0 37 | } 38 | return count 39 | } 40 | 41 | func ReadPosts(userId string, limit int, offset int) []models.Post { 42 | var posts []models.Post 43 | rows, err := db.Query( 44 | `SELECT * FROM posts WHERE user_id = $1 ORDER BY created_at DESC 45 | LIMIT $2 OFFSET $3`, 46 | userId, limit, offset, 47 | ) 48 | if err != nil { 49 | log.Println(err) 50 | return nil 51 | } 52 | 53 | defer rows.Close() 54 | for rows.Next() { 55 | var post models.Post 56 | rows.Scan(&post.UserId, &post.Id, &post.Body, &post.CreatedAt) 57 | posts = append(posts, post) 58 | } 59 | return posts 60 | } 61 | 62 | func ReadFeedPosts(userId string, limit int, offset int) []models.Post { 63 | var posts []models.Post 64 | rows, err := db.Query( 65 | `SELECT * FROM posts WHERE user_id IN 66 | (SELECT follow_id FROM follows WHERE user_id = $1) 67 | ORDER BY created_at DESC 68 | LIMIT $2 OFFSET $3`, 69 | userId, limit, offset, 70 | ) 71 | if err != nil { 72 | log.Println(err) 73 | return nil 74 | } 75 | defer rows.Close() 76 | for rows.Next() { 77 | var post models.Post 78 | rows.Scan(&post.UserId, &post.Id, &post.Body, &post.CreatedAt) 79 | posts = append(posts, post) 80 | } 81 | return posts 82 | } 83 | 84 | func DeletePost(id string) bool { 85 | if _, err := db.Exec(`DELETE FROM posts WHERE id = $1`, id); err != nil { 86 | log.Println(err) 87 | return false 88 | } 89 | return true 90 | } 91 | 92 | func Voted(userId string, id string) bool { 93 | var count int 94 | db.QueryRow( 95 | `SELECT COUNT(*) FROM votes WHERE user_id = $1 AND id = $2`, 96 | userId, id, 97 | ).Scan(&count) 98 | 99 | switch count { 100 | case 0: 101 | return false 102 | default: 103 | return true 104 | } 105 | } 106 | 107 | func ToggleVote(userId string, id string) { 108 | var query string 109 | voted := Voted(userId, id) 110 | 111 | switch voted { 112 | case false: 113 | query = `INSERT INTO votes (user_id, id) VALUES ($1, $2)` 114 | default: 115 | query = `DELETE FROM votes WHERE user_id = $1 AND id = $2` 116 | } 117 | if _, err := db.Exec(query, userId, id); err != nil { 118 | log.Println(err) 119 | } 120 | } 121 | 122 | func ReadVotes(id string) []string { 123 | var voters []string 124 | rows, err := db.Query( 125 | `SELECT username FROM t_users WHERE id IN 126 | (SELECT user_id FROM votes WHERE id = $1)`, 127 | id, 128 | ) 129 | if err != nil { 130 | log.Println(err) 131 | return nil 132 | } 133 | defer rows.Close() 134 | for rows.Next() { 135 | var username string 136 | rows.Scan(&username) 137 | voters = append(voters, username) 138 | } 139 | return voters 140 | } 141 | 142 | func CreateComment(userId string, postId string, comment *models.Comment) bool { 143 | if _, err := db.Exec( 144 | `INSERT INTO comments (user_id, post_id, id, body, created_at) 145 | VALUES ($1, $2, $3, $4, $5)`, 146 | userId, postId, comment.Id, comment.Body, comment.CreatedAt, 147 | ); err != nil { 148 | log.Println(err) 149 | return false 150 | } 151 | return true 152 | } 153 | 154 | func ReadComment(id string) *models.Comment { 155 | var comment models.Comment 156 | if err := db.QueryRow(`SELECT * FROM comments WHERE id = $1`, id).Scan( 157 | &comment.UserId, 158 | &comment.PostId, 159 | &comment.Id, 160 | &comment.Body, 161 | &comment.CreatedAt, 162 | ); err != nil { 163 | log.Println(err) 164 | return nil 165 | } 166 | return &comment 167 | } 168 | 169 | func ReadComments(postId string, limit int, offset int) []models.Comment { 170 | var comments []models.Comment 171 | rows, err := db.Query( 172 | `SELECT * FROM comments WHERE post_id = $1 173 | ORDER BY created_at DESC 174 | LIMIT $2 OFFSET $3`, 175 | postId, limit, offset, 176 | ) 177 | if err != nil { 178 | log.Println(err) 179 | return nil 180 | } 181 | defer rows.Close() 182 | for rows.Next() { 183 | var comment models.Comment 184 | rows.Scan( 185 | &comment.UserId, 186 | &comment.PostId, 187 | &comment.Id, 188 | &comment.Body, 189 | &comment.CreatedAt, 190 | ) 191 | comments = append(comments, comment) 192 | } 193 | return comments 194 | } 195 | 196 | func DeleteComment(id string) bool { 197 | if _, err := db.Exec(`DELETE FROM comments WHERE id = $1`, id); err != nil { 198 | log.Println(err) 199 | return false 200 | } 201 | return true 202 | } 203 | -------------------------------------------------------------------------------- /database/postgres.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "database/sql" 5 | "io/ioutil" 6 | "os" 7 | 8 | "github.com/joho/godotenv" 9 | _ "github.com/lib/pq" 10 | ) 11 | 12 | var db *sql.DB 13 | 14 | func init() { 15 | godotenv.Load(".env") 16 | var err error 17 | db, err = sql.Open("postgres", os.Getenv("POSTGRES_URI")) 18 | if err != nil { 19 | panic(err) 20 | } 21 | data, err := ioutil.ReadFile("database/init.sql") 22 | if err != nil { 23 | panic(err) 24 | } 25 | script := string(data) 26 | if _, err := db.Exec(script); err != nil { 27 | panic(err) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/user.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | 7 | "github.com/Devansh3712/tsuki-go/models" 8 | "github.com/lib/pq" 9 | ) 10 | 11 | func CreateUser(user *models.User) bool { 12 | if _, err := db.Exec( 13 | `INSERT INTO t_users(email, username, password, id, verified, avatar, created_at) 14 | VALUES ($1, $2, $3, $4, $5, $6, $7)`, 15 | user.Email, 16 | user.Username, 17 | user.Password, 18 | user.Id, 19 | user.Verified, 20 | user.Avatar, 21 | user.CreatedAt, 22 | ); err != nil { 23 | log.Println(err) 24 | return false 25 | } 26 | return true 27 | } 28 | 29 | func CreateOAuthUser(id string) bool { 30 | if _, err := db.Exec(`INSERT INTO o_users(id) VALUES ($1)`, id); err != nil { 31 | log.Println(err) 32 | return false 33 | } 34 | return true 35 | } 36 | 37 | func ReadUserByName(username string) *models.User { 38 | var user models.User 39 | if err := db.QueryRow(`SELECT * FROM t_users WHERE username = $1`, username).Scan( 40 | &user.Email, 41 | &user.Username, 42 | &user.Password, 43 | &user.Id, 44 | &user.Verified, 45 | &user.Avatar, 46 | &user.CreatedAt, 47 | ); err != nil { 48 | log.Println(err) 49 | return nil 50 | } 51 | return &user 52 | } 53 | 54 | func ReadUserByEmail(email string) *models.User { 55 | var user models.User 56 | if err := db.QueryRow(`SELECT * FROM t_users WHERE email = $1`, email).Scan( 57 | &user.Email, 58 | &user.Username, 59 | &user.Password, 60 | &user.Id, 61 | &user.Verified, 62 | &user.Avatar, 63 | &user.CreatedAt, 64 | ); err != nil { 65 | log.Println(err) 66 | return nil 67 | } 68 | return &user 69 | } 70 | 71 | func ReadUserById(id string) *models.User { 72 | var user models.User 73 | if err := db.QueryRow(`SELECT * FROM t_users WHERE id = $1`, id).Scan( 74 | &user.Email, 75 | &user.Username, 76 | &user.Password, 77 | &user.Id, 78 | &user.Verified, 79 | &user.Avatar, 80 | &user.CreatedAt, 81 | ); err != nil { 82 | log.Println(err) 83 | return nil 84 | } 85 | return &user 86 | } 87 | 88 | func IsOAuthUser(id string) bool { 89 | var count int 90 | db.QueryRow(`SELECT COUNT(*) FROM o_users WHERE id = $1`, id).Scan(&count) 91 | switch count { 92 | case 0: 93 | return false 94 | default: 95 | return true 96 | } 97 | } 98 | 99 | func ReadUsers(username string, limit int, offset int) []models.User { 100 | var users []models.User 101 | rows, err := db.Query( 102 | `SELECT * FROM t_users WHERE username LIKE $1 ORDER BY username 103 | LIMIT $2 OFFSET $3`, 104 | "%"+username+"%", limit, offset) 105 | if err != nil { 106 | log.Println(err) 107 | return nil 108 | } 109 | defer rows.Close() 110 | for rows.Next() { 111 | var user models.User 112 | rows.Scan( 113 | &user.Email, 114 | &user.Username, 115 | &user.Password, 116 | &user.Id, 117 | &user.Verified, 118 | &user.Avatar, 119 | &user.CreatedAt, 120 | ) 121 | users = append(users, user) 122 | } 123 | return users 124 | } 125 | 126 | func UpdateUser(id string, updates map[string]any) bool { 127 | for column := range updates { 128 | if _, err := db.Exec( 129 | fmt.Sprintf(`UPDATE t_users SET %s = $1 WHERE id = $2`, pq.QuoteIdentifier(column)), 130 | updates[column], id, 131 | ); err != nil { 132 | log.Println(err) 133 | return false 134 | } 135 | } 136 | return true 137 | } 138 | 139 | func DeleteUser(id string) bool { 140 | if _, err := db.Exec(`DELETE FROM t_users WHERE id = $1`, id); err != nil { 141 | log.Println(err) 142 | return false 143 | } 144 | return true 145 | } 146 | 147 | func Followed(userId string, followId string) bool { 148 | var count int 149 | db.QueryRow( 150 | `SELECT COUNT(*) FROM follows WHERE user_id = $1 AND follow_id = $2`, 151 | userId, followId, 152 | ).Scan(&count) 153 | 154 | switch count { 155 | case 0: 156 | return false 157 | default: 158 | return true 159 | } 160 | } 161 | 162 | func ToggleFollow(userId string, followId string) { 163 | var query string 164 | voted := Followed(userId, followId) 165 | 166 | switch voted { 167 | case false: 168 | query = `INSERT INTO follows(user_id, follow_id) VALUES ($1, $2)` 169 | default: 170 | query = `DELETE FROM follows WHERE user_id = $1 AND follow_id = $2` 171 | } 172 | if _, err := db.Exec(query, userId, followId); err != nil { 173 | log.Println(err) 174 | } 175 | } 176 | 177 | func ReadFollowers(userId string) []string { 178 | var followers []string 179 | rows, err := db.Query( 180 | `SELECT username FROM t_users WHERE id in 181 | (SELECT user_id FROM follows WHERE follow_id = $1)`, 182 | userId, 183 | ) 184 | if err != nil { 185 | log.Println(err) 186 | return nil 187 | } 188 | 189 | defer rows.Close() 190 | for rows.Next() { 191 | var username string 192 | rows.Scan(&username) 193 | followers = append(followers, username) 194 | } 195 | return followers 196 | } 197 | 198 | func ReadFollowersCount(userId string) int { 199 | var count int 200 | if err := db.QueryRow( 201 | `SELECT COUNT(*) FROM t_users WHERE id in 202 | (SELECT user_id FROM follows WHERE follow_id = $1)`, 203 | userId, 204 | ).Scan(&count); err != nil { 205 | return 0 206 | } 207 | return count 208 | } 209 | 210 | func ReadFollowing(userId string) []string { 211 | var followers []string 212 | rows, err := db.Query( 213 | `SELECT username FROM t_users WHERE id in 214 | (SELECT follow_id FROM follows WHERE user_id = $1)`, 215 | userId, 216 | ) 217 | if err != nil { 218 | log.Println(err) 219 | return nil 220 | } 221 | 222 | defer rows.Close() 223 | for rows.Next() { 224 | var username string 225 | rows.Scan(&username) 226 | followers = append(followers, username) 227 | } 228 | return followers 229 | } 230 | 231 | func ReadFollowingCount(userId string) int { 232 | var count int 233 | if err := db.QueryRow( 234 | `SELECT COUNT(*) FROM t_users WHERE id in 235 | (SELECT follow_id FROM follows WHERE user_id = $1)`, 236 | userId, 237 | ).Scan(&count); err != nil { 238 | return 0 239 | } 240 | return count 241 | } 242 | 243 | func CreateVerificationId(token string, id string) bool { 244 | if _, err := db.Exec( 245 | `INSERT INTO shorturl(token, id) VALUES ($1, $2)`, token, id, 246 | ); err != nil { 247 | log.Println(err) 248 | return false 249 | } 250 | return true 251 | } 252 | 253 | func ReadVerificationId(id string) string { 254 | var token string 255 | if err := db.QueryRow( 256 | `SELECT token FROM shorturl WHERE id = $1`, id, 257 | ).Scan(&token); err != nil { 258 | log.Println(err) 259 | return "" 260 | } 261 | return token 262 | } 263 | 264 | func DeleteVerificationId(id string) bool { 265 | if _, err := db.Exec(`DELETE FROM shorturl WHERE id = $1`, id); err != nil { 266 | log.Println(err) 267 | return false 268 | } 269 | return true 270 | } 271 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Devansh3712/tsuki-go 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/dgrijalva/jwt-go v3.2.0+incompatible 7 | github.com/gin-contrib/sessions v0.0.5 8 | github.com/gin-gonic/gin v1.8.1 9 | github.com/google/uuid v1.3.0 10 | github.com/joho/godotenv v1.4.0 11 | github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible 12 | github.com/lib/pq v1.10.6 13 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa 14 | golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c 15 | golang.org/x/text v0.3.7 16 | google.golang.org/api v0.89.0 17 | ) 18 | 19 | require ( 20 | cloud.google.com/go/compute v1.7.0 // indirect 21 | github.com/gin-contrib/sse v0.1.0 // indirect 22 | github.com/go-playground/locales v0.14.0 // indirect 23 | github.com/go-playground/universal-translator v0.18.0 // indirect 24 | github.com/go-playground/validator/v10 v10.10.0 // indirect 25 | github.com/goccy/go-json v0.9.7 // indirect 26 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect 27 | github.com/golang/protobuf v1.5.2 // indirect 28 | github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect 29 | github.com/googleapis/gax-go/v2 v2.4.0 // indirect 30 | github.com/gorilla/context v1.1.1 // indirect 31 | github.com/gorilla/securecookie v1.1.1 // indirect 32 | github.com/gorilla/sessions v1.2.1 // indirect 33 | github.com/json-iterator/go v1.1.12 // indirect 34 | github.com/leodido/go-urn v1.2.1 // indirect 35 | github.com/mattn/go-isatty v0.0.14 // indirect 36 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect 37 | github.com/modern-go/reflect2 v1.0.2 // indirect 38 | github.com/pelletier/go-toml/v2 v2.0.1 // indirect 39 | github.com/ugorji/go/codec v1.2.7 // indirect 40 | go.opencensus.io v0.23.0 // indirect 41 | golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect 42 | golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect 43 | google.golang.org/appengine v1.6.7 // indirect 44 | google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect 45 | google.golang.org/grpc v1.47.0 // indirect 46 | google.golang.org/protobuf v1.28.0 // indirect 47 | gopkg.in/yaml.v2 v2.4.0 // indirect 48 | ) 49 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 9 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 10 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 11 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 12 | cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= 13 | cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= 14 | cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= 15 | cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= 16 | cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= 17 | cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= 18 | cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= 19 | cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= 20 | cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= 21 | cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= 22 | cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= 23 | cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= 24 | cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= 25 | cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= 26 | cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= 27 | cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= 28 | cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= 29 | cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= 30 | cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= 31 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 32 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 33 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 34 | cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 35 | cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= 36 | cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= 37 | cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= 38 | cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= 39 | cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= 40 | cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= 41 | cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= 42 | cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= 43 | cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= 44 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 45 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 46 | cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= 47 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 48 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 49 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 50 | cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= 51 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 52 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 53 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 54 | cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= 55 | cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= 56 | cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= 57 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 58 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 59 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 60 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 61 | github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 62 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 63 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 64 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 65 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 66 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 67 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 68 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 69 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 70 | github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 71 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 72 | github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= 73 | github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 74 | github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 75 | github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 76 | github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 77 | github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 78 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 79 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 80 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 81 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 82 | github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= 83 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 84 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 85 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 86 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 87 | github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= 88 | github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 89 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 90 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= 91 | github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= 92 | github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= 93 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 94 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 95 | github.com/gin-contrib/sessions v0.0.5 h1:CATtfHmLMQrMNpJRgzjWXD7worTh7g7ritsQfmF+0jE= 96 | github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs97miaG2+7neKY= 97 | github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= 98 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 99 | github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= 100 | github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= 101 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 102 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 103 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 104 | github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= 105 | github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 106 | github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= 107 | github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= 108 | github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= 109 | github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= 110 | github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= 111 | github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= 112 | github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= 113 | github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= 114 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 115 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 116 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 117 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= 118 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 119 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 120 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 121 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 122 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 123 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 124 | github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 125 | github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 126 | github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= 127 | github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= 128 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 129 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 130 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 131 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 132 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 133 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 134 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 135 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 136 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 137 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 138 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 139 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 140 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 141 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 142 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 143 | github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= 144 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 145 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 146 | github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 147 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 148 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 149 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 150 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 151 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 152 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 153 | github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 154 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 155 | github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 156 | github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 157 | github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 158 | github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 159 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 160 | github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 161 | github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 162 | github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= 163 | github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 164 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 165 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 166 | github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 167 | github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 168 | github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= 169 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 170 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 171 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 172 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 173 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 174 | github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 175 | github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 176 | github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 177 | github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 178 | github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 179 | github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 180 | github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 181 | github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 182 | github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 183 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 184 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 185 | github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 186 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 187 | github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= 188 | github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= 189 | github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= 190 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 191 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 192 | github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= 193 | github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= 194 | github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= 195 | github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= 196 | github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= 197 | github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= 198 | github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= 199 | github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= 200 | github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= 201 | github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= 202 | github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= 203 | github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= 204 | github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= 205 | github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= 206 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 207 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 208 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 209 | github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 210 | github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= 211 | github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= 212 | github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= 213 | github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= 214 | github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= 215 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 216 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 217 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 218 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 219 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 220 | github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 221 | github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= 222 | github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= 223 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 224 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 225 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 226 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 227 | github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= 228 | github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= 229 | github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= 230 | github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 231 | github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= 232 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 233 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= 234 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 235 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= 236 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 237 | github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= 238 | github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= 239 | github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 240 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 241 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 242 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 243 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= 244 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 245 | github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 246 | github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= 247 | github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= 248 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 249 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 250 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 251 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 252 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 253 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 254 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 255 | github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= 256 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 257 | github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= 258 | github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= 259 | github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= 260 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 261 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 262 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 263 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 264 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 265 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 266 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 267 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 268 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 269 | go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 270 | go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= 271 | go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= 272 | go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= 273 | go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 274 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 275 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 276 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 277 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 278 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 279 | golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 280 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= 281 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 282 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 283 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 284 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 285 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 286 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 287 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 288 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 289 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 290 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 291 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 292 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 293 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 294 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 295 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 296 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 297 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 298 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 299 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 300 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 301 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 302 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 303 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 304 | golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 305 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 306 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 307 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 308 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 309 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 310 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 311 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 312 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 313 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 314 | golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 315 | golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 316 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 317 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 318 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 319 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 320 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 321 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 322 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 323 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 324 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 325 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 326 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 327 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 328 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 329 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 330 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 331 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 332 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 333 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 334 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 335 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 336 | golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 337 | golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 338 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 339 | golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 340 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 341 | golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 342 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 343 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 344 | golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 345 | golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 346 | golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 347 | golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 348 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 349 | golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= 350 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 351 | golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 352 | golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 353 | golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 354 | golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 355 | golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 356 | golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 357 | golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 358 | golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= 359 | golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 360 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 361 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 362 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 363 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 364 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 365 | golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 366 | golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 367 | golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 368 | golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 369 | golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 370 | golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 371 | golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 372 | golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 373 | golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 374 | golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 375 | golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 376 | golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 377 | golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 378 | golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 379 | golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= 380 | golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= 381 | golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY= 382 | golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= 383 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 384 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 385 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 386 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 387 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 388 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 389 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 390 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 391 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 392 | golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 393 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 394 | golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 395 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 396 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 397 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 398 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 399 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 400 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 401 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 402 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 403 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 404 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 405 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 406 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 407 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 408 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 409 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 410 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 411 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 412 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 413 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 414 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 415 | golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 416 | golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 417 | golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 418 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 419 | golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 420 | golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 421 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 422 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 423 | golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 424 | golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 425 | golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 426 | golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 427 | golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 428 | golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 429 | golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 430 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 431 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 432 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 433 | golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 434 | golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 435 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 436 | golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 437 | golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 438 | golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 439 | golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 440 | golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 441 | golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 442 | golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 443 | golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 444 | golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 445 | golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 446 | golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 447 | golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 448 | golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 449 | golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 450 | golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 451 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 452 | golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 453 | golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= 454 | golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 455 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 456 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 457 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 458 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 459 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 460 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 461 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 462 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 463 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 464 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 465 | golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= 466 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 467 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 468 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 469 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 470 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 471 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 472 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 473 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 474 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 475 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 476 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 477 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 478 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 479 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 480 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 481 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 482 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 483 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 484 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 485 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 486 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 487 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 488 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 489 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 490 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 491 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 492 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 493 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 494 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 495 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 496 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 497 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 498 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 499 | golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 500 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 501 | golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 502 | golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 503 | golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 504 | golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 505 | golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 506 | golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 507 | golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 508 | golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 509 | golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 510 | golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= 511 | golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 512 | golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 513 | golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 514 | golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 515 | golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= 516 | golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 517 | golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 518 | golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 519 | golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 520 | golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 521 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 522 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 523 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 524 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 525 | golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 526 | golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= 527 | golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= 528 | golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= 529 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 530 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 531 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 532 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 533 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 534 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 535 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 536 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 537 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 538 | google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 539 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 540 | google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 541 | google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 542 | google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 543 | google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= 544 | google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 545 | google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= 546 | google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= 547 | google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= 548 | google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= 549 | google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= 550 | google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= 551 | google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= 552 | google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= 553 | google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= 554 | google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= 555 | google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= 556 | google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= 557 | google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= 558 | google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= 559 | google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= 560 | google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= 561 | google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= 562 | google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= 563 | google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= 564 | google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= 565 | google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= 566 | google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= 567 | google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= 568 | google.golang.org/api v0.89.0 h1:OUywo5UEEZ8H1eMy55mFpkL9Sy59mQ5TzYGWa+td8zo= 569 | google.golang.org/api v0.89.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= 570 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 571 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 572 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 573 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 574 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 575 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 576 | google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= 577 | google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 578 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 579 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 580 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 581 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 582 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 583 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 584 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 585 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 586 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 587 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 588 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 589 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 590 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 591 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 592 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 593 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 594 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 595 | google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 596 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 597 | google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 598 | google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 599 | google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 600 | google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 601 | google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 602 | google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= 603 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 604 | google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= 605 | google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 606 | google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 607 | google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 608 | google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 609 | google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 610 | google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 611 | google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 612 | google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 613 | google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 614 | google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 615 | google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 616 | google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 617 | google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= 618 | google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= 619 | google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= 620 | google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= 621 | google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= 622 | google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= 623 | google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= 624 | google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= 625 | google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= 626 | google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= 627 | google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= 628 | google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= 629 | google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= 630 | google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= 631 | google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= 632 | google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= 633 | google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= 634 | google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 635 | google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 636 | google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 637 | google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 638 | google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 639 | google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 640 | google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 641 | google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= 642 | google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= 643 | google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= 644 | google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= 645 | google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= 646 | google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 647 | google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 648 | google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 649 | google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 650 | google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 651 | google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= 652 | google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= 653 | google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= 654 | google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 655 | google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 656 | google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f h1:hJ/Y5SqPXbarffmAsApliUlcvMU+wScNGfyop4bZm8o= 657 | google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 658 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 659 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 660 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 661 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 662 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 663 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 664 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 665 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 666 | google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= 667 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 668 | google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 669 | google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 670 | google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 671 | google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= 672 | google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= 673 | google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= 674 | google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 675 | google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 676 | google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 677 | google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 678 | google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 679 | google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 680 | google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= 681 | google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= 682 | google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= 683 | google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= 684 | google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= 685 | google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= 686 | google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 687 | google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 688 | google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= 689 | google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 690 | google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 691 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 692 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 693 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 694 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 695 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 696 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 697 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 698 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 699 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 700 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 701 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 702 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 703 | google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 704 | google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= 705 | google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 706 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 707 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 708 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 709 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 710 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 711 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 712 | gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 713 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 714 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 715 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 716 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= 717 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 718 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 719 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 720 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 721 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 722 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 723 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 724 | honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 725 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 726 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 727 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 728 | -------------------------------------------------------------------------------- /internal/auth/discord.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "log" 7 | "net/http" 8 | "net/url" 9 | "os" 10 | "time" 11 | 12 | "github.com/Devansh3712/tsuki-go/database" 13 | "github.com/Devansh3712/tsuki-go/internal" 14 | "github.com/Devansh3712/tsuki-go/middleware" 15 | "github.com/Devansh3712/tsuki-go/models" 16 | "github.com/gin-contrib/sessions" 17 | "github.com/gin-gonic/gin" 18 | "github.com/google/uuid" 19 | "github.com/joho/godotenv" 20 | ) 21 | 22 | func init() { 23 | godotenv.Load(".env") 24 | } 25 | 26 | func DiscordSignUp(c *gin.Context) { 27 | c.Redirect(http.StatusFound, os.Getenv("DISCORD_SIGNUP_URL")) 28 | } 29 | 30 | func DiscordLogin(c *gin.Context) { 31 | c.Redirect(http.StatusFound, os.Getenv("DISCORD_LOGIN_URL")) 32 | } 33 | 34 | func DiscordAuth(c *gin.Context) { 35 | // Retrieve user access token 36 | api := "https://discord.com/api/v10" 37 | authCode := c.Query("code") 38 | data := url.Values{ 39 | "client_id": []string{os.Getenv("DISCORD_CLIENT_ID")}, 40 | "client_secret": []string{os.Getenv("DISCORD_CLIENT_SECRET")}, 41 | "grant_type": []string{"authorization_code"}, 42 | "code": []string{authCode}, 43 | } 44 | switch c.Query("login") { 45 | case "true": 46 | data.Add("redirect_uri", "https://tsukigo.herokuapp.com/auth/discord?login=true") 47 | default: 48 | data.Add("redirect_uri", "https://tsukigo.herokuapp.com/auth/discord") 49 | } 50 | response, err := http.PostForm(api+"/oauth2/token", data) 51 | if err != nil { 52 | log.Println(err) 53 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 54 | "error": "400 Bad Request", 55 | "message": "Unable to retrieve access token, try again later.", 56 | }) 57 | return 58 | } 59 | defer response.Body.Close() 60 | var responseData map[string]interface{} 61 | if err := json.NewDecoder(response.Body).Decode(&responseData); err != nil { 62 | log.Println(err) 63 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 64 | "error": "400 Bad Request", 65 | "message": "Unable to parse authorization response, try again later.", 66 | }) 67 | return 68 | } 69 | accessToken := responseData["access_token"].(string) 70 | // Fetch user data 71 | request, _ := http.NewRequest("GET", api+"/users/@me", nil) 72 | request.Header.Add("Authorization", "Bearer "+accessToken) 73 | client := &http.Client{} 74 | response, err = client.Do(request) 75 | if err != nil { 76 | log.Println(err) 77 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 78 | "error": "400 Bad Request", 79 | "message": "Unable to make authorization request, try again later.", 80 | }) 81 | return 82 | } 83 | defer response.Body.Close() 84 | var authUser models.DiscordUser 85 | if err := json.NewDecoder(response.Body).Decode(&authUser); err != nil { 86 | log.Println(err) 87 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 88 | "error": "400 Bad Request", 89 | "message": "Unable to parse authorization response, try again later.", 90 | }) 91 | return 92 | } 93 | // Signup or login user 94 | exists := database.ReadUserByEmail(*authUser.Email) 95 | log.Println(exists) 96 | switch c.Query("login") { 97 | case "true": 98 | if exists == nil { 99 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 100 | "error": "401 Unauthorized", 101 | "message": "User does not exist.", 102 | }) 103 | return 104 | } 105 | token, _ := middleware.CreateToken(exists.Id) 106 | session := sessions.Default(c) 107 | session.Set("Authorization", token) 108 | session.Save() 109 | c.Redirect(http.StatusFound, "/feed") 110 | default: 111 | if exists != nil { 112 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 113 | "error": "403 Forbidden", 114 | "message": "Account already exists with the given email.", 115 | }) 116 | return 117 | } 118 | var user models.User 119 | user.Username = authUser.Username 120 | // Update the username if it already exists in the database 121 | if result := database.ReadUserByName(user.Username); result != nil { 122 | user.Username += internal.RandomString(32 - len(authUser.Username)) 123 | } 124 | user.CreatedAt = time.Now() 125 | user.Email = authUser.Email 126 | user.Verified = authUser.Verified 127 | user.Id = uuid.NewString() 128 | // Generate a random password for oauth user 129 | user.Password = uuid.NewString() 130 | user.HashPassword() 131 | if authUser.Avatar != nil { 132 | avatar := fmt.Sprintf("https://cdn.discordapp.com/avatars/%s/%s", authUser.DiscordId, *authUser.Avatar) 133 | user.Avatar = &avatar 134 | } 135 | if res := database.CreateUser(&user); !res { 136 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 137 | "error": "400 Bad Request", 138 | "message": "Unable to create account, try again later.", 139 | }) 140 | return 141 | } 142 | // Add to table that identifies OAuth users 143 | database.CreateOAuthUser(user.Id) 144 | token, _ := middleware.CreateToken(user.Id) 145 | session := sessions.Default(c) 146 | session.Set("Authorization", token) 147 | session.Save() 148 | if user.Verified { 149 | c.Redirect(http.StatusFound, "/user/") 150 | } else { 151 | c.Redirect(http.StatusFound, "/auth/verify?signup=true") 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /internal/auth/github.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "log" 7 | "net/http" 8 | "net/url" 9 | "os" 10 | "time" 11 | 12 | "github.com/Devansh3712/tsuki-go/database" 13 | "github.com/Devansh3712/tsuki-go/internal" 14 | "github.com/Devansh3712/tsuki-go/middleware" 15 | "github.com/Devansh3712/tsuki-go/models" 16 | "github.com/gin-contrib/sessions" 17 | "github.com/gin-gonic/gin" 18 | "github.com/google/uuid" 19 | ) 20 | 21 | const GITHUB_URL = "https://github.com/login/oauth" 22 | 23 | func GitHubSignUp(c *gin.Context) { 24 | api, _ := url.Parse(GITHUB_URL + "/authorize") 25 | params := url.Values{ 26 | "client_id": []string{os.Getenv("GITHUB_CLIENT_ID")}, 27 | "redirect_uri": []string{"https://tsukigo.herokuapp.com/auth/github"}, 28 | } 29 | api.RawQuery = params.Encode() 30 | api.RawQuery += "&scope=read:user,user:email" 31 | c.Redirect(http.StatusFound, api.String()) 32 | } 33 | 34 | func GitHubLogin(c *gin.Context) { 35 | api, _ := url.Parse(GITHUB_URL + "/authorize") 36 | params := url.Values{ 37 | "client_id": []string{os.Getenv("GITHUB_CLIENT_ID")}, 38 | "redirect_uri": []string{"https://tsukigo.herokuapp.com/auth/github?login=true"}, 39 | } 40 | api.RawQuery = params.Encode() 41 | api.RawQuery += "&scope=read:user,user:email" 42 | c.Redirect(http.StatusFound, api.String()) 43 | } 44 | 45 | func GitHubAuth(c *gin.Context) { 46 | // Retrieve user access token 47 | authCode := c.Query("code") 48 | client := &http.Client{} 49 | data := url.Values{ 50 | "client_id": []string{os.Getenv("GITHUB_CLIENT_ID")}, 51 | "client_secret": []string{os.Getenv("GITHUB_CLIENT_SECRET")}, 52 | "code": []string{authCode}, 53 | } 54 | switch c.Query("login") { 55 | case "true": 56 | data.Add("redirect_uri", "https://tsukigo.herokuapp.com/auth/github?login=true") 57 | default: 58 | data.Add("redirect_uri", "https://tsukigo.herokuapp.com/auth/github") 59 | } 60 | request, _ := http.NewRequest( 61 | "POST", GITHUB_URL+"/access_token", bytes.NewBuffer([]byte(data.Encode())), 62 | ) 63 | request.Header.Set("Accept", "application/json") 64 | response, err := client.Do(request) 65 | if err != nil { 66 | log.Println(err) 67 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 68 | "error": "400 Bad Request", 69 | "message": "Unable to retrieve access token, try again later.", 70 | }) 71 | return 72 | } 73 | defer response.Body.Close() 74 | var responseData map[string]interface{} 75 | if err := json.NewDecoder(response.Body).Decode(&responseData); err != nil { 76 | log.Println(err) 77 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 78 | "error": "400 Bad Request", 79 | "message": "Unable to parse authentication response, try again later.", 80 | }) 81 | return 82 | } 83 | accessToken := responseData["access_token"].(string) 84 | // Fetch user data 85 | request, _ = http.NewRequest("GET", "https://api.github.com/user", nil) 86 | request.Header.Add("Authorization", "Bearer "+accessToken) 87 | response, err = client.Do(request) 88 | if err != nil { 89 | log.Println(err) 90 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 91 | "error": "400 Bad Request", 92 | "message": "Unable to make authorization request, try again later.", 93 | }) 94 | return 95 | } 96 | defer response.Body.Close() 97 | var authUser models.GitHubUser 98 | if err := json.NewDecoder(response.Body).Decode(&authUser); err != nil { 99 | log.Println(err) 100 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 101 | "error": "400 Bad Request", 102 | "message": "Unable to parse authorization response, try again later.", 103 | }) 104 | return 105 | } 106 | // If email is null, make another GET request 107 | if authUser.Email == nil { 108 | request, _ = http.NewRequest("GET", "https://api.github.com/user/emails", nil) 109 | request.Header.Add("Authorization", "Bearer "+accessToken) 110 | response, err = client.Do(request) 111 | if err != nil { 112 | log.Println(err) 113 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 114 | "error": "400 Bad Request", 115 | "message": "Unable to make authorization request, try again later.", 116 | }) 117 | return 118 | } 119 | defer response.Body.Close() 120 | var emails []map[string]interface{} 121 | if err := json.NewDecoder(response.Body).Decode(&emails); err != nil { 122 | log.Println(err) 123 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 124 | "error": "400 Bad Request", 125 | "message": "Unable to parse authorization response, try again later.", 126 | }) 127 | return 128 | } 129 | email := emails[0]["email"].(string) 130 | authUser.Email = &email 131 | authUser.Verified = emails[0]["verified"].(bool) 132 | } 133 | // Signup or login user 134 | exists := database.ReadUserByEmail(*authUser.Email) 135 | switch c.Query("login") { 136 | case "true": 137 | if exists == nil { 138 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 139 | "error": "401 Unauthorized", 140 | "message": "User does not exist.", 141 | }) 142 | return 143 | } 144 | token, _ := middleware.CreateToken(exists.Id) 145 | session := sessions.Default(c) 146 | session.Set("Authorization", token) 147 | session.Save() 148 | c.Redirect(http.StatusFound, "/feed") 149 | default: 150 | if exists != nil { 151 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 152 | "error": "403 Forbidden", 153 | "message": "Account already exists with the given email.", 154 | }) 155 | return 156 | } 157 | var user models.User 158 | user.Username = authUser.Username 159 | // Update the username if it already exists in the database 160 | if result := database.ReadUserByName(user.Username); result != nil { 161 | user.Username += internal.RandomString(32 - len(authUser.Username)) 162 | } 163 | user.CreatedAt = time.Now() 164 | user.Email = authUser.Email 165 | user.Verified = authUser.Verified 166 | user.Id = uuid.NewString() 167 | // Generate a random password for oauth user 168 | user.Password = uuid.NewString() 169 | user.HashPassword() 170 | if res := database.CreateUser(&user); !res { 171 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 172 | "error": "400 Bad Request", 173 | "message": "Unable to create account, try again later.", 174 | }) 175 | return 176 | } 177 | // Add to table that identifies OAuth users 178 | database.CreateOAuthUser(user.Id) 179 | token, _ := middleware.CreateToken(user.Id) 180 | session := sessions.Default(c) 181 | session.Set("Authorization", token) 182 | session.Save() 183 | if user.Verified { 184 | c.Redirect(http.StatusFound, "/user/") 185 | } else { 186 | c.Redirect(http.StatusFound, "/auth/verify?signup=true") 187 | } 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /internal/auth/google.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "log" 7 | "net/http" 8 | "os" 9 | "time" 10 | 11 | "github.com/Devansh3712/tsuki-go/database" 12 | "github.com/Devansh3712/tsuki-go/internal" 13 | "github.com/Devansh3712/tsuki-go/middleware" 14 | "github.com/Devansh3712/tsuki-go/models" 15 | "github.com/gin-contrib/sessions" 16 | "github.com/gin-gonic/gin" 17 | "github.com/google/uuid" 18 | "golang.org/x/oauth2" 19 | "golang.org/x/oauth2/google" 20 | ) 21 | 22 | var config *oauth2.Config 23 | var state string 24 | 25 | func init() { 26 | state = os.Getenv("SECRET_KEY") 27 | config = &oauth2.Config{ 28 | ClientID: os.Getenv("GOOGLE_CLIENT_ID"), 29 | ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"), 30 | Scopes: []string{ 31 | "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", 32 | }, 33 | Endpoint: google.Endpoint, 34 | } 35 | } 36 | 37 | func GoogleSignUp(c *gin.Context) { 38 | config.RedirectURL = "https://tsukigo.herokuapp.com/auth/google" 39 | c.Redirect(http.StatusFound, config.AuthCodeURL(state)) 40 | } 41 | 42 | func GoogleLogin(c *gin.Context) { 43 | config.RedirectURL = "https://tsukigo.herokuapp.com/auth/google?login=true" 44 | c.Redirect(http.StatusFound, config.AuthCodeURL(state)) 45 | } 46 | 47 | func GoogleAuth(c *gin.Context) { 48 | if c.Query("state") != state { 49 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 50 | "error": "400 Bad Request", 51 | "message": "Invalid authorization URL.", 52 | }) 53 | return 54 | } 55 | switch c.Query("login") { 56 | case "true": 57 | config.RedirectURL = "https://tsukigo.herokuapp.com/auth/google?login=true" 58 | default: 59 | config.RedirectURL = "https://tsukigo.herokuapp.com/auth/google" 60 | } 61 | token, err := config.Exchange(context.Background(), c.Query("code")) 62 | if err != nil { 63 | log.Println(err) 64 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 65 | "error": "400 Bad Request", 66 | }) 67 | return 68 | } 69 | client := config.Client(context.Background(), token) 70 | response, err := client.Get("https://www.googleapis.com/oauth2/v3/userinfo") 71 | if err != nil { 72 | log.Println(err) 73 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 74 | "error": "400 Bad Request", 75 | "message": "Unable to retrieve authorization response, try again later.", 76 | }) 77 | return 78 | } 79 | defer response.Body.Close() 80 | var authUser models.GoogleUser 81 | if err := json.NewDecoder(response.Body).Decode(&authUser); err != nil { 82 | log.Println(err) 83 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 84 | "error": "400 Bad Request", 85 | "message": "Unable to parse authentication response, try again later.", 86 | }) 87 | return 88 | } 89 | // Signup or login user 90 | exists := database.ReadUserByEmail(authUser.Email) 91 | switch c.Query("login") { 92 | case "true": 93 | if exists == nil { 94 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 95 | "error": "401 Unauthorized", 96 | "message": "User does not exist.", 97 | }) 98 | return 99 | } 100 | token, _ := middleware.CreateToken(exists.Id) 101 | session := sessions.Default(c) 102 | session.Set("Authorization", token) 103 | session.Save() 104 | c.Redirect(http.StatusFound, "/feed") 105 | default: 106 | if exists != nil { 107 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 108 | "error": "403 Forbidden", 109 | "message": "Account already exists with the given email.", 110 | }) 111 | return 112 | } 113 | var user models.User 114 | user.Username = authUser.Username 115 | // Update the username if it already exists in the database 116 | if result := database.ReadUserByName(user.Username); result != nil { 117 | user.Username += internal.RandomString(32 - len(authUser.Username)) 118 | } 119 | user.CreatedAt = time.Now() 120 | user.Email = &authUser.Email 121 | user.Verified = authUser.Verified 122 | user.Id = uuid.NewString() 123 | // Generate a random password for oauth user 124 | user.Password = uuid.NewString() 125 | user.HashPassword() 126 | if authUser.Avatar != nil { 127 | user.Avatar = authUser.Avatar 128 | } 129 | if res := database.CreateUser(&user); !res { 130 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 131 | "error": "400 Bad Request", 132 | "message": "Unable to create account, try again later.", 133 | }) 134 | return 135 | } 136 | // Add to table that identifies OAuth users 137 | database.CreateOAuthUser(user.Id) 138 | token, _ := middleware.CreateToken(user.Id) 139 | session := sessions.Default(c) 140 | session.Set("Authorization", token) 141 | session.Save() 142 | if user.Verified { 143 | c.Redirect(http.StatusFound, "/user/") 144 | } else { 145 | c.Redirect(http.StatusFound, "/auth/verify?signup=true") 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /internal/template.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "math/rand" 5 | "strings" 6 | "time" 7 | 8 | "golang.org/x/text/cases" 9 | "golang.org/x/text/language" 10 | ) 11 | 12 | func RandomString(length int) string { 13 | rand.Seed(time.Now().UnixNano()) 14 | const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" 15 | str := make([]byte, length) 16 | for index := range str { 17 | str[index] = chars[rand.Intn(len(chars))] 18 | } 19 | return string(str) 20 | } 21 | 22 | func FormatAsTitle(title string) string { 23 | title = cases.Title(language.Und, cases.NoLower).String(title) 24 | formatted := strings.ReplaceAll(title, "_", " ") 25 | return formatted 26 | } 27 | 28 | func FormatAsDate(createdAt time.Time) string { 29 | return createdAt.Format(time.RFC822) 30 | } 31 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "html/template" 5 | "net/http" 6 | "os" 7 | 8 | "github.com/Devansh3712/tsuki-go/internal" 9 | socials "github.com/Devansh3712/tsuki-go/internal/auth" 10 | "github.com/Devansh3712/tsuki-go/middleware" 11 | "github.com/Devansh3712/tsuki-go/routes" 12 | "github.com/gin-contrib/sessions" 13 | "github.com/gin-contrib/sessions/cookie" 14 | "github.com/gin-gonic/gin" 15 | "github.com/joho/godotenv" 16 | ) 17 | 18 | func index(c *gin.Context) { 19 | c.HTML(http.StatusOK, "index.tmpl.html", nil) 20 | } 21 | 22 | func notFound(c *gin.Context) { 23 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 24 | "error": "404 Not Found", 25 | "message": "The requested page was not found.", 26 | }) 27 | } 28 | 29 | func main() { 30 | godotenv.Load(".env") 31 | gin.SetMode(gin.ReleaseMode) 32 | 33 | app := gin.Default() 34 | app.RedirectTrailingSlash = true 35 | app.HandleMethodNotAllowed = true 36 | app.NoRoute(notFound) 37 | 38 | app.Static("/static", "./static") 39 | app.SetFuncMap(template.FuncMap{ 40 | "formatAsTitle": internal.FormatAsTitle, 41 | "formatAsDate": internal.FormatAsDate, 42 | }) 43 | app.LoadHTMLGlob("templates/*") 44 | store := cookie.NewStore([]byte(os.Getenv("SECRET_KEY"))) 45 | app.Use(sessions.Sessions("tsuki", store)) 46 | app.Use(middleware.RecoveryMiddleware()) 47 | 48 | app.GET("/", index) 49 | app.GET("/signup", routes.SignUp) 50 | app.GET("/login", routes.Login) 51 | app.GET("/logout", routes.Logout) 52 | app.GET("/feed", middleware.AuthMiddleware(), routes.UserFeed) 53 | app.GET("/feed/more", middleware.AuthMiddleware(), routes.LoadMoreFeed) 54 | 55 | auth := app.Group("/auth") 56 | { 57 | auth.GET("/signup/discord", socials.DiscordSignUp) 58 | auth.GET("/signup/github", socials.GitHubSignUp) 59 | auth.GET("/signup/google", socials.GoogleSignUp) 60 | auth.GET("/login/discord", socials.DiscordLogin) 61 | auth.GET("/login/github", socials.GitHubLogin) 62 | auth.GET("/login/google", socials.GoogleLogin) 63 | auth.GET("/discord", socials.DiscordAuth) 64 | auth.GET("/github", socials.GitHubAuth) 65 | auth.GET("/google", socials.GoogleAuth) 66 | auth.GET("/verify", middleware.AuthMiddleware(), routes.SendVerificationMail) 67 | auth.GET("/verify/:id", routes.Verify) 68 | 69 | auth.POST("/signup", routes.SignUp) 70 | auth.POST("/login", routes.Login) 71 | } 72 | 73 | user := app.Group("/user") 74 | user.GET("/:username", routes.GetUserByName) 75 | user.GET("/:username/posts", routes.GetUserPosts) 76 | user.GET("/:username/posts/more", routes.LoadMorePosts) 77 | user.Use(middleware.AuthMiddleware()) 78 | { 79 | user.GET("/", routes.GetUser) 80 | user.GET("/settings/avatar", routes.UpdateAvatar) 81 | user.GET("/settings/username", routes.UpdateUsername) 82 | user.GET("/settings/password", routes.UpdatePassword) 83 | user.GET("/settings/delete", routes.DeleteUser) 84 | 85 | user.POST("/:username/toggle-follow", routes.ToggleFollow) 86 | user.POST("/settings/avatar", routes.UpdateAvatar) 87 | user.POST("/settings/username", routes.UpdateUsername) 88 | user.POST("/settings/password", routes.UpdatePassword) 89 | user.POST("/settings/delete", routes.DeleteUser) 90 | } 91 | 92 | search := app.Group("/search") 93 | { 94 | search.GET("/", routes.SearchUser) 95 | search.GET("/more", routes.LoadMoreUsers) 96 | 97 | search.POST("/", routes.SearchUser) 98 | search.POST("/:username/toggle-follow", middleware.AuthMiddleware(), routes.ToggleSearchFollow) 99 | } 100 | 101 | post := app.Group("/post") 102 | post.GET("/:id", routes.GetPost) 103 | post.Use(middleware.AuthMiddleware()) 104 | { 105 | post.GET("/", routes.NewPost) 106 | post.GET("/:id/toggle-vote", routes.ToggleVote) 107 | post.GET("/:id/delete", routes.DeletePost) 108 | post.GET("/:id/comments", routes.LoadMoreComments) 109 | post.GET("/:id/comment/delete", routes.DeleteComment) 110 | 111 | post.POST("/", routes.NewPost) 112 | post.POST("/:id/comment", routes.Comment) 113 | } 114 | 115 | if err := app.Run(); err != nil { 116 | panic(err) 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /middleware/auth.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "errors" 5 | "net/http" 6 | "os" 7 | "time" 8 | 9 | "github.com/dgrijalva/jwt-go" 10 | "github.com/gin-contrib/sessions" 11 | "github.com/gin-gonic/gin" 12 | "github.com/joho/godotenv" 13 | ) 14 | 15 | type JWTClaims struct { 16 | UserId string 17 | jwt.StandardClaims 18 | } 19 | 20 | var ( 21 | issuer string 22 | secretKey []byte 23 | errInvalidToken = errors.New("invalid token") 24 | ) 25 | 26 | func init() { 27 | godotenv.Load(".env") 28 | issuer = os.Getenv("ISSUER") 29 | secretKey = []byte(os.Getenv("SECRET_KEY")) 30 | } 31 | 32 | func CreateToken(id string) (string, error) { 33 | claims := JWTClaims{ 34 | id, 35 | jwt.StandardClaims{ 36 | Issuer: issuer, 37 | IssuedAt: time.Now().Unix(), 38 | }, 39 | } 40 | token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) 41 | return token.SignedString(secretKey) 42 | } 43 | 44 | func ParseToken(token string) (*JWTClaims, error) { 45 | parsedToken, err := jwt.ParseWithClaims(token, &JWTClaims{}, func(t *jwt.Token) (interface{}, error) { 46 | return secretKey, nil 47 | }) 48 | if err != nil { 49 | return nil, err 50 | } 51 | if claims, ok := parsedToken.Claims.(*JWTClaims); ok && parsedToken.Valid { 52 | return claims, nil 53 | } 54 | return nil, errInvalidToken 55 | } 56 | 57 | func AuthMiddleware() func(c *gin.Context) { 58 | return func(c *gin.Context) { 59 | session := sessions.Default(c) 60 | token := session.Get("Authorization") 61 | if token == nil { 62 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 63 | "error": "401 Unauthorized", 64 | "message": "User not logged in.", 65 | }) 66 | c.Abort() 67 | return 68 | } 69 | parsedToken, err := ParseToken(token.(string)) 70 | if err != nil { 71 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 72 | "error": "401 Unauthorized", 73 | "message": "Invalid authorization token, try logging in again.", 74 | }) 75 | c.Abort() 76 | return 77 | } 78 | session.Set("userId", parsedToken.UserId) 79 | session.Save() 80 | c.Next() 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /middleware/error.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gin-gonic/gin" 7 | ) 8 | 9 | func RecoveryMiddleware() func(c *gin.Context) { 10 | return func(c *gin.Context) { 11 | c.Next() 12 | defer func() { 13 | if err := recover(); err != nil { 14 | c.HTML(http.StatusInternalServerError, "error.tmpl.html", gin.H{ 15 | "error": "500 Internal Server Error", 16 | "message": "An unexpected error occured, try again later.", 17 | }) 18 | } 19 | c.Abort() 20 | }() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /models/post.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "time" 4 | 5 | type Post struct { 6 | UserId string 7 | Id string 8 | Body string `form:"body" binding:"required"` 9 | Username string 10 | Avatar *string 11 | CreatedAt time.Time 12 | } 13 | 14 | type Comment struct { 15 | UserId string 16 | PostId string 17 | Id string 18 | Body string `form:"body" binding:"required"` 19 | Username string 20 | Self bool 21 | CreatedAt time.Time 22 | } 23 | -------------------------------------------------------------------------------- /models/user.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/crypto/bcrypt" 7 | ) 8 | 9 | type User struct { 10 | Email *string `form:"email" binding:"required"` 11 | Username string `form:"username" binding:"required"` 12 | Password string `form:"password" binding:"required"` 13 | Id string 14 | Verified bool 15 | Avatar *string 16 | CreatedAt time.Time 17 | } 18 | 19 | type DiscordUser struct { 20 | Email *string `json:"email"` 21 | Username string `json:"username"` 22 | Verified bool 23 | Avatar *string `json:"avatar"` 24 | DiscordId string `json:"id"` 25 | } 26 | 27 | type GitHubUser struct { 28 | Email *string `json:"email"` 29 | Username string `json:"login"` 30 | Verified bool 31 | Avatar *string `json:"avatar_url"` 32 | } 33 | 34 | type GoogleUser struct { 35 | Email string `json:"email"` 36 | Username string `json:"given_name"` 37 | Avatar *string `json:"picture"` 38 | Verified bool `json:"email_verified"` 39 | } 40 | 41 | type Login struct { 42 | Username string `form:"username" binding:"required"` 43 | Password string `form:"password" binding:"required"` 44 | } 45 | 46 | func (u *User) HashPassword() error { 47 | hash, err := bcrypt.GenerateFromPassword([]byte(u.Password), bcrypt.DefaultCost) 48 | if err != nil { 49 | return err 50 | } 51 | u.Password = string(hash) 52 | return nil 53 | } 54 | 55 | func (u *User) CheckPassword(password string) bool { 56 | err := bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(password)) 57 | return err == nil 58 | } 59 | -------------------------------------------------------------------------------- /routes/auth.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | "time" 7 | 8 | "github.com/Devansh3712/tsuki-go/database" 9 | "github.com/Devansh3712/tsuki-go/middleware" 10 | "github.com/Devansh3712/tsuki-go/models" 11 | "github.com/gin-contrib/sessions" 12 | "github.com/gin-gonic/gin" 13 | "github.com/gin-gonic/gin/binding" 14 | "github.com/google/uuid" 15 | "github.com/joho/godotenv" 16 | ) 17 | 18 | var ( 19 | issuer string 20 | secretKey []byte 21 | ) 22 | 23 | func init() { 24 | godotenv.Load(".env") 25 | issuer = os.Getenv("ISSUER") 26 | secretKey = []byte(os.Getenv("SECRET_KEY")) 27 | } 28 | 29 | func SignUp(c *gin.Context) { 30 | switch c.Request.Method { 31 | case "GET": 32 | c.HTML(http.StatusOK, "auth.tmpl.html", gin.H{ 33 | "type": "signup", 34 | }) 35 | case "POST": 36 | var user models.User 37 | if err := c.Request.ParseForm(); err != nil { 38 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 39 | "error": "400 Bad Request", 40 | "message": "Unable to parse form.", 41 | }) 42 | return 43 | } 44 | if err := c.ShouldBindWith(&user, binding.Form); err != nil { 45 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 46 | "error": "400 Bad Request", 47 | "message": err.Error(), 48 | }) 49 | return 50 | } 51 | if user := database.ReadUserByName(user.Username); user != nil { 52 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 53 | "error": "403 Forbidden", 54 | "message": "Account already exists with the given username.", 55 | }) 56 | return 57 | } 58 | user.CreatedAt = time.Now() 59 | user.Id = uuid.NewString() 60 | user.Verified = false 61 | user.HashPassword() 62 | if res := database.CreateUser(&user); !res { 63 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 64 | "error": "403 Forbidden", 65 | "message": "Account already exists with the given email.", 66 | }) 67 | return 68 | } 69 | // Set authorization token for user 70 | token, _ := middleware.CreateToken(user.Id) 71 | session := sessions.Default(c) 72 | session.Set("Authorization", token) 73 | session.Save() 74 | c.Redirect(http.StatusFound, "/auth/verify?signup=true") 75 | } 76 | } 77 | 78 | func Login(c *gin.Context) { 79 | switch c.Request.Method { 80 | case "GET": 81 | c.HTML(http.StatusOK, "auth.tmpl.html", gin.H{ 82 | "type": "login", 83 | }) 84 | case "POST": 85 | var login models.Login 86 | if err := c.Request.ParseForm(); err != nil { 87 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 88 | "error": "400 Bad Request", 89 | "message": "Unable to parse form.", 90 | }) 91 | return 92 | } 93 | if err := c.ShouldBindWith(&login, binding.Form); err != nil { 94 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 95 | "error": "403 Forbidden", 96 | "message": err.Error(), 97 | }) 98 | return 99 | } 100 | user := database.ReadUserByName(login.Username) 101 | if user == nil { 102 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 103 | "error": "401 Unauthorized", 104 | "message": "User does not exist.", 105 | }) 106 | return 107 | } 108 | if !user.CheckPassword(login.Password) { 109 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 110 | "error": "401 Unauthorized", 111 | "message": "Incorrect password.", 112 | }) 113 | return 114 | } 115 | token, _ := middleware.CreateToken(user.Id) 116 | session := sessions.Default(c) 117 | session.Set("Authorization", token) 118 | session.Save() 119 | c.Redirect(http.StatusFound, "/feed") 120 | } 121 | } 122 | 123 | func Logout(c *gin.Context) { 124 | session := sessions.Default(c) 125 | id := session.Get("userId") 126 | if id == nil { 127 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 128 | "error": "401 Unauthorized", 129 | "message": "User not logged in.", 130 | }) 131 | return 132 | } 133 | // Remove all session headers 134 | session.Clear() 135 | session.Options(sessions.Options{MaxAge: -1}) 136 | session.Save() 137 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 138 | "message": "Logged out successfully.", 139 | }) 140 | } 141 | -------------------------------------------------------------------------------- /routes/feed.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/Devansh3712/tsuki-go/database" 7 | "github.com/gin-contrib/sessions" 8 | "github.com/gin-gonic/gin" 9 | ) 10 | 11 | var feedLimit = 10 12 | 13 | func UserFeed(c *gin.Context) { 14 | session := sessions.Default(c) 15 | id := session.Get("userId") 16 | if id == nil { 17 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 18 | "error": "401 Unauthorized", 19 | "message": "User not logged in.", 20 | }) 21 | return 22 | } 23 | feedLimit = 10 24 | posts := database.ReadFeedPosts(id.(string), 10, 0) 25 | for index := range posts { 26 | author := database.ReadUserById(posts[index].UserId) 27 | posts[index].Username = author.Username 28 | posts[index].Avatar = author.Avatar 29 | } 30 | c.HTML(http.StatusOK, "feed.tmpl.html", gin.H{ 31 | "posts": posts, 32 | }) 33 | } 34 | 35 | // Return feed posts for loading through AJAX 36 | func LoadMoreFeed(c *gin.Context) { 37 | session := sessions.Default(c) 38 | id := session.Get("userId") 39 | posts := database.ReadFeedPosts(id.(string), 10, feedLimit) 40 | feedLimit += 10 41 | for index := range posts { 42 | author := database.ReadUserById(posts[index].UserId) 43 | posts[index].Username = author.Username 44 | posts[index].Avatar = author.Avatar 45 | } 46 | c.JSON(http.StatusOK, posts) 47 | } 48 | -------------------------------------------------------------------------------- /routes/post.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | 7 | "github.com/Devansh3712/tsuki-go/database" 8 | "github.com/Devansh3712/tsuki-go/models" 9 | "github.com/gin-contrib/sessions" 10 | "github.com/gin-gonic/gin" 11 | "github.com/gin-gonic/gin/binding" 12 | "github.com/google/uuid" 13 | ) 14 | 15 | var commentLimit = 10 16 | 17 | func NewPost(c *gin.Context) { 18 | session := sessions.Default(c) 19 | id := session.Get("userId") 20 | if id == nil { 21 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 22 | "error": "401 Unauthorized", 23 | "message": "User not logged in.", 24 | }) 25 | return 26 | } 27 | switch c.Request.Method { 28 | case "GET": 29 | c.HTML(http.StatusOK, "makePost.tmpl.html", nil) 30 | case "POST": 31 | var post models.Post 32 | if err := c.Request.ParseForm(); err != nil { 33 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 34 | "error": "400 Bad Request", 35 | "message": "Unable to parse form.", 36 | }) 37 | return 38 | } 39 | if err := c.ShouldBindWith(&post, binding.Form); err != nil { 40 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 41 | "error": "400 Bad Request", 42 | "message": err.Error(), 43 | }) 44 | return 45 | } 46 | post.Id = uuid.NewString() 47 | post.CreatedAt = time.Now() 48 | if result := database.CreatePost(id.(string), &post); !result { 49 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 50 | "error": "400 Bad Request", 51 | "message": "Unable to create post, try again later.", 52 | }) 53 | return 54 | } 55 | c.Redirect(http.StatusFound, "/post/"+post.Id) 56 | } 57 | } 58 | 59 | func GetPost(c *gin.Context) { 60 | var self, voted bool 61 | session := sessions.Default(c) 62 | id := session.Get("userId") 63 | postId := c.Param("id") 64 | post := database.ReadPost(postId) 65 | if post == nil { 66 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 67 | "error": "404 Not Found", 68 | "message": "Post not found or doesn't exist.", 69 | }) 70 | return 71 | } 72 | commentLimit = 10 73 | comments := database.ReadComments(post.Id, 10, 0) 74 | for index := range comments { 75 | comments[index].Username = database.ReadUserById(comments[index].UserId).Username 76 | // Enable delete comment if its current user's comment 77 | if id != nil && id.(string) == comments[index].UserId { 78 | comments[index].Self = true 79 | } 80 | } 81 | if id != nil { 82 | // Check if current user has voted on post 83 | voted = database.Voted(id.(string), post.Id) 84 | // Enable delete post if its current user's post 85 | if id.(string) == post.UserId { 86 | self = true 87 | } 88 | } 89 | c.HTML(http.StatusOK, "getPost.tmpl.html", gin.H{ 90 | "author": database.ReadUserById(post.UserId), 91 | "post": post, 92 | "self": self, 93 | "voted": voted, 94 | "voters": database.ReadVotes(post.Id), 95 | "comments": comments, 96 | }) 97 | } 98 | 99 | // Return comments for loading through AJAX 100 | func LoadMoreComments(c *gin.Context) { 101 | session := sessions.Default(c) 102 | id := session.Get("userId") 103 | postId := c.Param("id") 104 | comments := database.ReadComments(postId, 10, commentLimit) 105 | commentLimit += 10 106 | for index := range comments { 107 | comments[index].Username = database.ReadUserById(comments[index].UserId).Username 108 | // Enable delete comment if its current user's comment 109 | if id != nil && id.(string) == comments[index].UserId { 110 | comments[index].Self = true 111 | } 112 | } 113 | c.JSON(http.StatusOK, comments) 114 | } 115 | 116 | func DeletePost(c *gin.Context) { 117 | session := sessions.Default(c) 118 | id := session.Get("userId") 119 | if id == nil { 120 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 121 | "error": "401 Unauthorized", 122 | "message": "User not logged in.", 123 | }) 124 | return 125 | } 126 | postId := c.Param("id") 127 | post := database.ReadPost(postId) 128 | if id.(string) != post.UserId { 129 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 130 | "error": "401 Unauthorized", 131 | "message": "Cannot perform this task.", 132 | }) 133 | return 134 | } 135 | if result := database.DeletePost(post.Id); !result { 136 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 137 | "error": "400 Bad Request", 138 | "message": "Unable to delete post, try again later.", 139 | }) 140 | return 141 | } 142 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 143 | "message": "Post deleted successfully.", 144 | }) 145 | } 146 | 147 | func ToggleVote(c *gin.Context) { 148 | session := sessions.Default(c) 149 | id := session.Get("userId") 150 | if id == nil { 151 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 152 | "error": "401 Unauthorized", 153 | "message": "User not logged in.", 154 | }) 155 | return 156 | } 157 | postId := c.Param("id") 158 | database.ToggleVote(id.(string), postId) 159 | c.Redirect(http.StatusFound, "/post/"+postId) 160 | } 161 | 162 | func Comment(c *gin.Context) { 163 | session := sessions.Default(c) 164 | id := session.Get("userId") 165 | if id == nil { 166 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 167 | "error": "401 Unauthorized", 168 | "message": "User not logged in.", 169 | }) 170 | return 171 | } 172 | var comment models.Comment 173 | if err := c.Request.ParseForm(); err != nil { 174 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 175 | "error": "400 Bad Request", 176 | "message": "Unable to parse form.", 177 | }) 178 | return 179 | } 180 | if err := c.ShouldBindWith(&comment, binding.Form); err != nil { 181 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 182 | "error": "400 Bad Request", 183 | "message": err.Error(), 184 | }) 185 | return 186 | } 187 | postId := c.Param("id") 188 | comment.Id = uuid.NewString() 189 | comment.CreatedAt = time.Now() 190 | if result := database.CreateComment(id.(string), postId, &comment); !result { 191 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 192 | "error": "400 Bad Request", 193 | "message": "Unable to add comment, try again later.", 194 | }) 195 | return 196 | } 197 | c.Redirect(http.StatusFound, "/post/"+postId) 198 | } 199 | 200 | func DeleteComment(c *gin.Context) { 201 | session := sessions.Default(c) 202 | id := session.Get("userId") 203 | if id == nil { 204 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 205 | "error": "401 Unauthorized", 206 | "message": "User not logged in.", 207 | }) 208 | return 209 | } 210 | postId := c.Param("id") 211 | commentId := c.Query("commentId") 212 | comment := database.ReadComment(commentId) 213 | if comment == nil { 214 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 215 | "error": "404 Not Found", 216 | "message": "Comment not found.", 217 | }) 218 | return 219 | } 220 | if id.(string) != comment.UserId { 221 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 222 | "error": "401 Unauthorized", 223 | "message": "Cannot perform this task.", 224 | }) 225 | return 226 | } 227 | if result := database.DeleteComment(commentId); !result { 228 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 229 | "error": "400 Bad Request", 230 | "message": "Unable to delete comment, try again later.", 231 | }) 232 | return 233 | } 234 | c.Redirect(http.StatusFound, "/post/"+postId) 235 | } 236 | -------------------------------------------------------------------------------- /routes/search.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/Devansh3712/tsuki-go/database" 7 | "github.com/Devansh3712/tsuki-go/models" 8 | "github.com/gin-contrib/sessions" 9 | "github.com/gin-gonic/gin" 10 | ) 11 | 12 | var searchLimit = 10 13 | 14 | type search struct { 15 | models.User 16 | Followers int 17 | Following int 18 | Posts int 19 | Follows any 20 | } 21 | 22 | func SearchUser(c *gin.Context) { 23 | session := sessions.Default(c) 24 | switch c.Request.Method { 25 | case "GET": 26 | searchLimit = 10 27 | session.Delete("search") 28 | session.Save() 29 | c.HTML(http.StatusOK, "search.tmpl.html", nil) 30 | case "POST": 31 | id := session.Get("userId") 32 | if c.PostForm("search") != "" { 33 | session.Set("search", c.PostForm("search")) 34 | session.Save() 35 | } 36 | keyword := session.Get("search").(string) 37 | searchLimit = 10 38 | searchResult := database.ReadUsers(keyword, 10, 0) 39 | var users []search 40 | for _, result := range searchResult { 41 | user := search{ 42 | User: result, 43 | Followers: database.ReadFollowersCount(result.Id), 44 | Following: database.ReadFollowingCount(result.Id), 45 | Posts: database.ReadPostsCount(result.Id), 46 | } 47 | if id != nil && id.(string) != result.Id { 48 | user.Follows = database.Followed(id.(string), result.Id) 49 | } 50 | users = append(users, user) 51 | } 52 | c.JSON(http.StatusOK, users) 53 | } 54 | } 55 | 56 | // Return users for loading through AJAX 57 | func LoadMoreUsers(c *gin.Context) { 58 | session := sessions.Default(c) 59 | id := session.Get("userId") 60 | keyword := session.Get("search").(string) 61 | searchResult := database.ReadUsers(keyword, 10, searchLimit) 62 | searchLimit += 10 63 | var users []search 64 | for _, result := range searchResult { 65 | user := search{ 66 | User: result, 67 | Followers: database.ReadFollowersCount(result.Id), 68 | Following: database.ReadFollowingCount(result.Id), 69 | Posts: database.ReadPostsCount(result.Id), 70 | } 71 | if id != nil && id.(string) != result.Id { 72 | user.Follows = database.Followed(id.(string), result.Id) 73 | } 74 | users = append(users, user) 75 | } 76 | c.JSON(http.StatusOK, users) 77 | } 78 | 79 | func ToggleSearchFollow(c *gin.Context) { 80 | session := sessions.Default(c) 81 | id := session.Get("userId") 82 | if id == nil { 83 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 84 | "error": "401 Unauthorized", 85 | "message": "User not logged in.", 86 | }) 87 | return 88 | } 89 | username := c.Param("username") 90 | toFollow := database.ReadUserByName(username) 91 | database.ToggleFollow(id.(string), toFollow.Id) 92 | } 93 | -------------------------------------------------------------------------------- /routes/user.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/json" 6 | "io/ioutil" 7 | "log" 8 | "net/http" 9 | "net/url" 10 | "os" 11 | 12 | "github.com/Devansh3712/tsuki-go/database" 13 | "github.com/gin-contrib/sessions" 14 | "github.com/gin-gonic/gin" 15 | ) 16 | 17 | var postLimit = 5 18 | 19 | func GetUser(c *gin.Context) { 20 | session := sessions.Default(c) 21 | id := session.Get("userId") 22 | if id == nil { 23 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 24 | "error": "401 Unauthorized", 25 | "message": "User not logged in.", 26 | }) 27 | return 28 | } 29 | userId := id.(string) 30 | c.HTML(http.StatusOK, "user.tmpl.html", gin.H{ 31 | "settings": true, 32 | "user": database.ReadUserById(userId), 33 | "postCount": database.ReadPostsCount(userId), 34 | "followers": database.ReadFollowers(userId), 35 | "following": database.ReadFollowing(userId), 36 | "posts": database.ReadPosts(userId, 5, 0), 37 | "oauth": database.IsOAuthUser(userId), 38 | }) 39 | } 40 | 41 | func GetUserByName(c *gin.Context) { 42 | username := c.Param("username") 43 | session := sessions.Default(c) 44 | id := session.Get("userId") 45 | if id != nil { 46 | user := database.ReadUserById(id.(string)) 47 | if username == user.Username { 48 | c.Redirect(http.StatusFound, "/user/") 49 | return 50 | } 51 | } 52 | user := database.ReadUserByName(username) 53 | if user == nil { 54 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 55 | "error": "404 Not Found", 56 | "message": "User not found", 57 | }) 58 | return 59 | } 60 | user.Email = nil 61 | followers := database.ReadFollowers(user.Id) 62 | following := database.ReadFollowing(user.Id) 63 | postCount := database.ReadPostsCount(user.Id) 64 | posts := database.ReadPosts(user.Id, 5, 0) 65 | 66 | if id != nil { 67 | c.HTML(http.StatusOK, "user.tmpl.html", gin.H{ 68 | "user": user, 69 | "postCount": postCount, 70 | "followers": followers, 71 | "following": following, 72 | "posts": posts, 73 | "follows": database.Followed(id.(string), user.Id), 74 | }) 75 | return 76 | } 77 | c.HTML(http.StatusOK, "user.tmpl.html", gin.H{ 78 | "user": user, 79 | "postCount": postCount, 80 | "followers": followers, 81 | "following": following, 82 | "posts": posts, 83 | }) 84 | } 85 | 86 | func GetUserPosts(c *gin.Context) { 87 | username := c.Param("username") 88 | user := database.ReadUserByName(username) 89 | if user == nil { 90 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 91 | "error": "404 Not Found", 92 | "message": "User not found", 93 | }) 94 | return 95 | } 96 | postLimit = 10 97 | posts := database.ReadPosts(user.Id, 10, 0) 98 | c.HTML(http.StatusOK, "userPosts.tmpl.html", gin.H{ 99 | "user": user, 100 | "posts": posts, 101 | }) 102 | } 103 | 104 | // Return posts for loading through AJAX 105 | func LoadMorePosts(c *gin.Context) { 106 | username := c.Param("username") 107 | user := database.ReadUserByName(username) 108 | posts := database.ReadPosts(user.Id, 10, postLimit) 109 | postLimit += 10 110 | c.JSON(http.StatusOK, posts) 111 | } 112 | 113 | func UpdateAvatar(c *gin.Context) { 114 | session := sessions.Default(c) 115 | id := session.Get("userId") 116 | if id == nil { 117 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 118 | "error": "401 Unauthorized", 119 | "message": "User not logged in.", 120 | }) 121 | return 122 | } 123 | switch c.Request.Method { 124 | case "GET": 125 | c.HTML(http.StatusOK, "update.tmpl.html", gin.H{ 126 | "type": "avatar", 127 | }) 128 | case "POST": 129 | // Read the image 130 | file, _, err := c.Request.FormFile("avatar") 131 | if err != nil { 132 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 133 | "error": "400 Bad Request", 134 | "message": "Unable to process request, try again later.", 135 | }) 136 | return 137 | } 138 | defer file.Close() 139 | fileData, err := ioutil.ReadAll(file) 140 | if err != nil { 141 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 142 | "error": "400 Bad Request", 143 | "message": "Unable to read image, try again later.", 144 | }) 145 | return 146 | } 147 | // Post the image to Freeimage API 148 | encoded := base64.StdEncoding.EncodeToString(fileData) 149 | response, err := http.PostForm( 150 | "https://freeimage.host/api/1/upload?key="+os.Getenv("FREEIMAGE_API_KEY")+"&format=json", 151 | url.Values{"source": {encoded}}, 152 | ) 153 | if err != nil { 154 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 155 | "error": "400 Bad Request", 156 | "message": "Unable to read image, try again later.", 157 | }) 158 | return 159 | } 160 | defer response.Body.Close() 161 | var responseData map[string]interface{} 162 | if err := json.NewDecoder(response.Body).Decode(&responseData); err != nil { 163 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 164 | "error": "400 Bad Request", 165 | "message": "Unable to upload avatar, try again later.", 166 | }) 167 | return 168 | } 169 | // Update user avatar URL 170 | if result := database.UpdateUser( 171 | id.(string), 172 | map[string]any{"avatar": responseData["image"].(map[string]interface{})["url"]}, 173 | ); !result { 174 | log.Println(responseData) 175 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 176 | "error": "400 Bad Request", 177 | "message": "Unable to update avatar, try again later.", 178 | }) 179 | return 180 | } 181 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 182 | "message": "Avatar updated successfully.", 183 | }) 184 | } 185 | } 186 | 187 | func UpdateUsername(c *gin.Context) { 188 | session := sessions.Default(c) 189 | id := session.Get("userId") 190 | if id == nil { 191 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 192 | "error": "401 Unauthorized", 193 | "message": "User not logged in.", 194 | }) 195 | return 196 | } 197 | switch c.Request.Method { 198 | case "GET": 199 | c.HTML(http.StatusOK, "update.tmpl.html", gin.H{ 200 | "type": "username", 201 | }) 202 | case "POST": 203 | newUsername := c.PostForm("username") 204 | user := database.ReadUserById(id.(string)) 205 | if user.Username == newUsername { 206 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 207 | "error": "403 Forbidden", 208 | "message": "New username cannot be the same as current.", 209 | }) 210 | return 211 | } 212 | if exists := database.ReadUserByName(newUsername); exists != nil { 213 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 214 | "error": "403 Forbidden", 215 | "message": "Username not available or already taken.", 216 | }) 217 | return 218 | } 219 | if result := database.UpdateUser(user.Id, map[string]any{"username": newUsername}); !result { 220 | c.HTML(http.StatusInternalServerError, "error.tmpl.html", gin.H{ 221 | "error": "500 Internal Server Error", 222 | "message": "Unable to change username, try again later.", 223 | }) 224 | return 225 | } 226 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 227 | "message": "Username updated successfully", 228 | }) 229 | } 230 | } 231 | 232 | func UpdatePassword(c *gin.Context) { 233 | session := sessions.Default(c) 234 | id := session.Get("userId") 235 | if id == nil { 236 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 237 | "error": "401 Unauthorized", 238 | "message": "User not logged in.", 239 | }) 240 | return 241 | } 242 | switch c.Request.Method { 243 | case "GET": 244 | c.HTML(http.StatusOK, "update.tmpl.html", gin.H{ 245 | "type": "password", 246 | }) 247 | case "POST": 248 | newPassword := c.PostForm("password") 249 | user := database.ReadUserById(id.(string)) 250 | if user.CheckPassword(newPassword) { 251 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 252 | "error": "403 Forbidden", 253 | "message": "New password cannot cannot be same as the current.", 254 | }) 255 | return 256 | } 257 | // Create hash of new password and update it 258 | user.Password = newPassword 259 | user.HashPassword() 260 | if result := database.UpdateUser(id.(string), map[string]any{"password": user.Password}); !result { 261 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 262 | "error": "400 Bad Request", 263 | "message": "Unable to change password, try again later.", 264 | }) 265 | return 266 | } 267 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 268 | "message": "Password updated successfully", 269 | }) 270 | } 271 | } 272 | 273 | func DeleteUser(c *gin.Context) { 274 | session := sessions.Default(c) 275 | id := session.Get("userId") 276 | if id == nil { 277 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 278 | "error": "401 Unauthorized", 279 | "message": "User not logged in.", 280 | }) 281 | return 282 | } 283 | switch c.Request.Method { 284 | case "GET": 285 | c.HTML(http.StatusOK, "delete.tmpl.html", gin.H{ 286 | "oauth": database.IsOAuthUser(id.(string)), 287 | }) 288 | case "POST": 289 | user := database.ReadUserById(id.(string)) 290 | // Password required for users who didn't sign up through OAuth 291 | if !database.IsOAuthUser(user.Id) { 292 | password := c.PostForm("password") 293 | if !user.CheckPassword(password) { 294 | c.HTML(http.StatusForbidden, "error.tmpl.html", gin.H{ 295 | "error": "403 Forbidden", 296 | "message": "Incorrect password.", 297 | }) 298 | return 299 | } 300 | } 301 | if result := database.DeleteUser(user.Id); !result { 302 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 303 | "error": "400 Bad Request", 304 | "message": "Unable to delete account, try again later.", 305 | }) 306 | return 307 | } 308 | session := sessions.Default(c) 309 | session.Clear() 310 | session.Options(sessions.Options{Path: "/", MaxAge: -1}) 311 | session.Save() 312 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 313 | "message": "Account deleted succesfully. つき が つかって くれて ありがとう ございました。", 314 | }) 315 | } 316 | } 317 | 318 | func ToggleFollow(c *gin.Context) { 319 | session := sessions.Default(c) 320 | id := session.Get("userId") 321 | if id == nil { 322 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 323 | "error": "401 Unauthorized", 324 | "message": "User not logged in.", 325 | }) 326 | return 327 | } 328 | username := c.Param("username") 329 | toFollow := database.ReadUserByName(username) 330 | database.ToggleFollow(id.(string), toFollow.Id) 331 | c.Redirect(http.StatusFound, "/user/"+username) 332 | } 333 | -------------------------------------------------------------------------------- /routes/verify.go: -------------------------------------------------------------------------------- 1 | package routes 2 | 3 | import ( 4 | "context" 5 | "encoding/base64" 6 | "fmt" 7 | "log" 8 | "net/http" 9 | "os" 10 | "time" 11 | 12 | "github.com/Devansh3712/tsuki-go/database" 13 | "github.com/Devansh3712/tsuki-go/middleware" 14 | "github.com/dgrijalva/jwt-go" 15 | "github.com/gin-contrib/sessions" 16 | "github.com/gin-gonic/gin" 17 | "github.com/google/uuid" 18 | "github.com/jordan-wright/email" 19 | "golang.org/x/oauth2" 20 | "google.golang.org/api/gmail/v1" 21 | "google.golang.org/api/option" 22 | ) 23 | 24 | const verificationMail = ` 25 |
26 | 33 |36 | Hi %s, please confirm that %s is your e-mail address by clicking this link %s within 48 hours. 37 |
38 | 39 | ` 40 | 41 | func createVerificationToken(id string) (string, error) { 42 | claims := middleware.JWTClaims{ 43 | UserId: id, 44 | StandardClaims: jwt.StandardClaims{ 45 | ExpiresAt: time.Now().Add(time.Hour * 48).Unix(), 46 | IssuedAt: time.Now().Unix(), 47 | Issuer: issuer, 48 | }, 49 | } 50 | token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) 51 | return token.SignedString(secretKey) 52 | } 53 | 54 | func oauth2Client() (*http.Client, error) { 55 | credentials := oauth2.Config{ 56 | ClientID: os.Getenv("CLIENT_ID"), 57 | ClientSecret: os.Getenv("CLIENT_SECRET"), 58 | Scopes: []string{"https://mail.google.com/"}, 59 | Endpoint: oauth2.Endpoint{ 60 | TokenURL: os.Getenv("TOKEN_URI"), 61 | }, 62 | } 63 | expiry, _ := time.Parse(time.RFC3339, os.Getenv("EXPIRY")) 64 | token := oauth2.Token{ 65 | AccessToken: os.Getenv("TOKEN"), 66 | RefreshToken: os.Getenv("REFRESH_TOKEN"), 67 | Expiry: expiry, 68 | } 69 | ctx := context.Background() 70 | if !token.Valid() { 71 | // Refresh the token 72 | refreshedToken, err := credentials.TokenSource(ctx, &token).Token() 73 | if err != nil { 74 | log.Println(err) 75 | return nil, err 76 | } 77 | os.Setenv("TOKEN", refreshedToken.AccessToken) 78 | os.Setenv("REFRESH_TOKEN", refreshedToken.RefreshToken) 79 | os.Setenv("EXPIRY", refreshedToken.Expiry.String()) 80 | return credentials.Client(ctx, refreshedToken), nil 81 | } 82 | return credentials.Client(ctx, &token), nil 83 | } 84 | 85 | func SendVerificationMail(c *gin.Context) { 86 | session := sessions.Default(c) 87 | id := session.Get("userId") 88 | if id == nil { 89 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 90 | "error": "401 Unauthorized", 91 | "message": "User not logged in.", 92 | }) 93 | return 94 | } 95 | client, err := oauth2Client() 96 | if err != nil { 97 | log.Println(err) 98 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 99 | "error": "400 Bad Request", 100 | "message": "Unable to send verification mail, try again later.", 101 | }) 102 | return 103 | } 104 | service, err := gmail.NewService(context.Background(), option.WithHTTPClient(client)) 105 | if err != nil { 106 | log.Println(err) 107 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 108 | "error": "400 Bad Request", 109 | "message": "Unable to send verification mail, try again later.", 110 | }) 111 | return 112 | } 113 | 114 | user := database.ReadUserById(id.(string)) 115 | verificationToken, _ := createVerificationToken(user.Id) 116 | verificationId := uuid.NewString() 117 | database.CreateVerificationId(verificationToken, verificationId) 118 | message := &email.Email{ 119 | To: []string{*user.Email}, 120 | From: os.Getenv("EMAIL"), 121 | Subject: "Verify your Tsuki account", 122 | HTML: []byte(fmt.Sprintf( 123 | verificationMail, 124 | user.Username, 125 | *user.Email, 126 | fmt.Sprintf("%s/auth/verify/%s", c.Request.Host, verificationId), 127 | )), 128 | } 129 | byteMessage, _ := message.Bytes() 130 | mailContent := gmail.Message{ 131 | Raw: base64.RawURLEncoding.EncodeToString(byteMessage), 132 | } 133 | if _, err := service.Users.Messages.Send("me", &mailContent).Do(); err != nil { 134 | log.Println(err) 135 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 136 | "error": "400 Bad Request", 137 | "message": "Unable to send verification mail, try again later.", 138 | }) 139 | return 140 | } 141 | response := fmt.Sprintf("Verification mail sent to %s", *user.Email) 142 | // Check if the request is redirected from signup 143 | if c.Query("signup") == "true" { 144 | response = "Account created succesfully. " + response 145 | } 146 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 147 | "message": response, 148 | }) 149 | } 150 | 151 | func Verify(c *gin.Context) { 152 | verificationId := c.Param("id") 153 | verificationToken := database.ReadVerificationId(verificationId) 154 | if verificationToken == "" { 155 | c.HTML(http.StatusNotFound, "error.tmpl.html", gin.H{ 156 | "error": "404 Not Found", 157 | "message": "Verification token not found in database.", 158 | }) 159 | } 160 | parsedToken, err := middleware.ParseToken(verificationToken) 161 | if err != nil { 162 | log.Println(err) 163 | c.HTML(http.StatusUnauthorized, "error.tmpl.html", gin.H{ 164 | "error": "401 Unauthorized", 165 | "message": "Invalid verification token, request a verification mail again.", 166 | }) 167 | return 168 | } 169 | userId := parsedToken.UserId 170 | user := database.ReadUserById(userId) 171 | if user.Verified { 172 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 173 | "message": "Account already verified.", 174 | }) 175 | return 176 | } 177 | if result := database.UpdateUser(userId, map[string]any{"verified": true}); !result { 178 | log.Println(err) 179 | c.HTML(http.StatusBadRequest, "error.tmpl.html", gin.H{ 180 | "error": "400 Bad Request", 181 | "message": "Unable to verify account, try again later.", 182 | }) 183 | return 184 | } 185 | c.HTML(http.StatusOK, "response.tmpl.html", gin.H{ 186 | "message": "Account verified successfully.", 187 | }) 188 | } 189 | -------------------------------------------------------------------------------- /static/images/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devansh3712/tsuki-go/3553acbfc726634b4b5c627cfa5a288f5985145d/static/images/avatar.jpg -------------------------------------------------------------------------------- /static/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devansh3712/tsuki-go/3553acbfc726634b4b5c627cfa5a288f5985145d/static/images/icon.png -------------------------------------------------------------------------------- /static/images/tsuki.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devansh3712/tsuki-go/3553acbfc726634b4b5c627cfa5a288f5985145d/static/images/tsuki.ico -------------------------------------------------------------------------------- /static/loadMore.js: -------------------------------------------------------------------------------- 1 | // Load more feed posts 2 | function loadMoreFeed() { 3 | $.ajax({ 4 | url: "/feed/more", 5 | type: "GET", 6 | success: function(data) { 7 | if (!data) { 8 | $("#more").remove() 9 | return 10 | } 11 | data.forEach(function(post) { 12 | content = ``; 13 | if (post.Avatar) { 14 | content += `${post.Body}
25 |${post.CreatedAt}
26 | `; 27 | $("#posts").append(content); 28 | }); 29 | if (data.length < 10) { 30 | $("#more").remove() 31 | } 32 | }, 33 | }); 34 | } 35 | 36 | // Load more comments on a post 37 | function loadMoreComments(postId) { 38 | $.ajax({ 39 | url: `/post/${postId}/comments`, 40 | type: "GET", 41 | success: function(data) { 42 | if (!data) { 43 | $("#more").remove() 44 | return 45 | } 46 | data.forEach(function(comment) { 47 | content = ` 48 |${comment.Body}
49 |50 | @${comment.Username} `; 51 | if (comment.Self) { 52 | content += ` 53 | 54 | Delete 55 | `; 56 | } 57 | content += `
`; 58 | $("#comments").append(content); 59 | }); 60 | if (data.length < 10) { 61 | $("#more").remove() 62 | } 63 | }, 64 | }); 65 | } 66 | 67 | // Load more users in search 68 | function loadMoreUsers() { 69 | $.ajax({ 70 | url: "/search/more", 71 | type: "GET", 72 | success: function(data) { 73 | if (!data) { 74 | return 75 | } 76 | $("#more").remove() 77 | data.forEach(function(user) { 78 | content = ` 79 | `; 80 | if (user.Avatar) { 81 | content += `104 | ${user.Posts} posts ${user.Followers} followers ${user.Following} 105 | following 106 |
`; 107 | $("#users").append(content); 108 | }); 109 | if (data.length == 10) { 110 | content = ` 111 |${post.Body}
138 |${post.CreatedAt}
139 | ` 140 | $("#posts").append(content); 141 | }); 142 | if (data.length < 10) { 143 | $("#more").remove() 144 | } 145 | }, 146 | }); 147 | } 148 | -------------------------------------------------------------------------------- /static/searchBar.js: -------------------------------------------------------------------------------- 1 | function loadUsers(str) { 2 | var div = document.getElementById("users"); 3 | if (str.length == 0) { 4 | div.innerHTML = `No users found.
`; 5 | return; 6 | } 7 | $.ajax({ 8 | url: "/search", 9 | type: "POST", 10 | data: { search: str }, 11 | success: function(data) { 12 | if (!data) { 13 | div.innerHTML = ` 14 |No users found.
`; 15 | return; 16 | } 17 | var content = ""; 18 | data.forEach(function(user) { 19 | content += ` 20 | `; 21 | if (user.Avatar) { 22 | content += `45 | ${user.Posts} posts ${user.Followers} followers ${user.Following} 46 | following 47 |
`; 48 | }); 49 | if (data.length == 10) { 50 | content += ` 51 |Sign up for a Tsuki account.
4 | {{ else if eq .type "login" }} 5 |Login to your Tsuki account.
7 | {{ end }} 8 |4 | Permanently delete your Tsuki account. On deleting your account, all related 5 | data will be lost. 6 |
7 | 8 | 34 | {{ template "bottom" . }} 35 | -------------------------------------------------------------------------------- /templates/error.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |{{ .Body }}
19 |{{ .CreatedAt }}
20 | 21 | {{ end }} 22 |No posts found.
33 | {{ end }} {{ template "bottom" . }} 34 | -------------------------------------------------------------------------------- /templates/getPost.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |{{ .post.Body }}
16 |18 | {{ len .voters }} Likes 19 | {{ len .comments }} Comments 20 |
21 |No comments found.
101 | {{ end }} {{ template "bottom" . }} 102 | -------------------------------------------------------------------------------- /templates/index.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |3 | Tsuki is a minimalistic open-sourced social media platform, built using 4 | Golang. 5 |
6 |9 | Tsuki (つき) is a noun meaning the moon in Japanese. The 10 | Tsuki project aims to be simple yet graceful like the moon. It is an easy to 11 | use minimal social media platform. 12 |
13 |14 | We chose this name due to the core developer's favourite Japanese quote, 15 | つきがきれいですね meaning 16 | the moon is beautiful, isn't it? 17 |
18 |21 | The Tsuki project is open for contributions on 22 | GitHub. 25 |
26 | {{ template "bottom" . }} 27 | -------------------------------------------------------------------------------- /templates/makePost.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |Create a new post from your account.
4 | 27 | {{ template "bottom" . }} 28 | -------------------------------------------------------------------------------- /templates/response.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} {{ .message }} {{ template "bottom" . }} 2 | -------------------------------------------------------------------------------- /templates/search.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |Update your Tsuki account {{ .type }}.
4 | 40 | {{ template "bottom" . }} 41 | -------------------------------------------------------------------------------- /templates/user.tmpl.html: -------------------------------------------------------------------------------- 1 | {{ template "top" . }} 2 |Email: {{ .user.Email }}
8 | {{ end }} 9 |Username: {{ .user.Username }}
10 |Verified: {{ .user.Verified }}
11 |Posts: {{ .postCount }}
12 |13 | Followers: {{ len .followers }} 14 |
15 |27 | Following: {{ len .following }} 28 |
29 |41 | Created At: {{ .user.CreatedAt | formatAsDate }} 42 |
43 | 44 | {{ if .user.Avatar }} 45 |73 | ➜ Update username 74 |
75 | {{ if eq .oauth false }} 76 |77 | ➜ Update password 78 |
79 | {{ end }} 80 |81 | ➜ Delete account 82 |
83 | {{ end }} 84 |{{ .Body }}
91 |{{ .CreatedAt }}
92 | 93 | {{ end }} {{ if gt .postCount 5 }} 94 |No posts found.
101 | {{ end }} 102 |{{ .Body }}
9 |{{ .CreatedAt }}
10 | 11 | {{ end }} 12 |No posts found.
22 | {{ end }} {{ template "bottom" . }} 23 | --------------------------------------------------------------------------------
{{ .Body }}
82 |83 | @{{ .Username }} {{ if .Self }} 84 | 85 | Delete 86 | 87 | {{ end }} 88 |
89 | {{ end }} 90 |