Skip to content

Commit 36cbdde

Browse files
author
Aleksandr Tihomirov
committed
Refactor application
1 parent d694319 commit 36cbdde

File tree

9 files changed

+12
-10
lines changed

9 files changed

+12
-10
lines changed

auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
import (
44
"encoding/json"

main.go renamed to cmd/disguard/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package main // import "go.zeta.pm/disguard/cmd/disguard"
22

33
import (
44
"io/ioutil"
55
"log"
66
"net/http"
77

88
"github.com/pressly/chi"
9+
"go.zeta.pm/disguard"
910
"gopkg.in/yaml.v2"
1011
)
1112

@@ -14,13 +15,13 @@ func main() {
1415
if err != nil {
1516
log.Fatal(err)
1617
}
17-
var conf Config
18+
var conf disguard.Config
1819
err = yaml.Unmarshal(in, &conf)
1920
if err != nil {
2021
log.Fatal(err)
2122
}
2223

23-
sess := NewSessionRouter(&conf)
24+
sess := disguard.NewSessionRouter(&conf)
2425

2526
root := chi.NewRouter()
2627
root.Route("/oauth", sess.Route)

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
type (
44
// Config ...

cookies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
import (
44
"net/http"

goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build:
2+
main: cmd/disguard/main.go
23
binary_name: disguard
34
goos:
45
- windows

guild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
// Guild mini-container, we only care about ID.
44
type Guild struct {

oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
import (
44
"fmt"

reverseproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22
import (
33
"log"
44
"net/http"

user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main // import "go.zeta.pm/disguard"
1+
package disguard // import "go.zeta.pm/disguard"
22

33
// User struct
44
type User struct {

0 commit comments

Comments
 (0)