Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stream-server.h-da.io
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stream Server Project
stream-server.h-da.io
Commits
2b927670
Commit
2b927670
authored
5 years ago
by
Simon Kirsten
Browse files
Options
Downloads
Patches
Plain Diff
Moved DefaultTwitchClientID and Version to config
parent
707d5f7d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/stream-server/main.go
+2
-1
2 additions, 1 deletion
cmd/stream-server/main.go
config.go
+10
-0
10 additions, 0 deletions
config.go
internal/server/server.go
+0
-3
0 additions, 3 deletions
internal/server/server.go
internal/server/twitch.go
+2
-5
2 additions, 5 deletions
internal/server/twitch.go
with
14 additions
and
9 deletions
cmd/stream-server/main.go
+
2
−
1
View file @
2b927670
...
...
@@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
streamserver
"stream-server"
"github.com/urfave/cli"
...
...
@@ -24,7 +25,7 @@ func main() {
app
.
Usage
=
docURL
app
.
HideHelp
=
true
app
.
Version
=
server
.
Version
app
.
Version
=
stream
server
.
Version
app
.
Flags
=
[]
cli
.
Flag
{
cli
.
IntFlag
{
...
...
This diff is collapsed.
Click to expand it.
config.go
0 → 100644
+
10
−
0
View file @
2b927670
package
streamserver
// For pager to work we need at least one .go file in the main folder so thats why this exists :)
// Version will automatically be set by the CI pipeline.
var
Version
=
"dev"
// DefaultTwitchClientID will automatically be set by the CI pipeline.
// for local builds the TWITCH_CLIENT_ID environment variable must be set
var
DefaultTwitchClientID
=
""
This diff is collapsed.
Click to expand it.
internal/server/server.go
+
0
−
3
View file @
2b927670
...
...
@@ -7,9 +7,6 @@ import (
"github.com/markbates/pkger"
)
// Version will automatically be set by the CI pipeline.
var
Version
=
"dev"
// ListenAndServe will listen and serve on the provided listenAddr
func
ListenAndServe
(
listenAddr
string
)
error
{
r
:=
chi
.
NewRouter
()
...
...
This diff is collapsed.
Click to expand it.
internal/server/twitch.go
+
2
−
5
View file @
2b927670
...
...
@@ -3,6 +3,7 @@ package server
import
(
"net/http"
"os"
streamserver
"stream-server"
"stream-server/internal/util"
"stream-server/pkg/twitch"
...
...
@@ -11,17 +12,13 @@ import (
// client is the Twitch Client instance
var
client
*
twitch
.
Client
// defaultTwitchClientID will automatically be set by the CI pipeline.
// for local builds the TWITCH_CLIENT_ID environment variable must be set
var
defaultTwitchClientID
string
func
init
()
{
// If you want to use your own twitch client id set the TWITCH_CLIENT_ID environment variable.
if
twitchClientID
:=
os
.
Getenv
(
"TWITCH_CLIENT_ID"
);
twitchClientID
!=
""
{
client
=
twitch
.
NewClient
(
twitchClientID
)
}
else
{
client
=
twitch
.
NewClient
(
d
efaultTwitchClientID
)
client
=
twitch
.
NewClient
(
streamserver
.
D
efaultTwitchClientID
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment