mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-10-23 15:33:20 +08:00
Initial commit, pt. 27
This commit is contained in:
@@ -2,16 +2,26 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"log"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/facebookincubator/go-belt"
|
"github.com/facebookincubator/go-belt"
|
||||||
"github.com/facebookincubator/go-belt/tool/logger"
|
"github.com/facebookincubator/go-belt/tool/logger"
|
||||||
"github.com/facebookincubator/go-belt/tool/logger/implementation/zap"
|
"github.com/facebookincubator/go-belt/tool/logger/implementation/zap"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
"github.com/xaionaro-go/streamctl/cmd/streamd/ui"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamd"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamd/grpc/go/streamd_grpc"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamd/server"
|
||||||
|
uiiface "github.com/xaionaro-go/streamctl/pkg/streamd/ui"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/xpath"
|
||||||
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
const forceNetPProfOnAndroid = true
|
const forceNetPProfOnAndroid = true
|
||||||
@@ -19,6 +29,7 @@ const forceNetPProfOnAndroid = true
|
|||||||
func main() {
|
func main() {
|
||||||
loggerLevel := logger.LevelWarning
|
loggerLevel := logger.LevelWarning
|
||||||
pflag.Var(&loggerLevel, "log-level", "Log level")
|
pflag.Var(&loggerLevel, "log-level", "Log level")
|
||||||
|
listenAddr := pflag.String("listen-addr", ":3594", "the address to listen for incoming connections to")
|
||||||
configPath := pflag.String("config-path", "/etc/streamd/streamd.yaml", "the path to the config file")
|
configPath := pflag.String("config-path", "/etc/streamd/streamd.yaml", "the path to the config file")
|
||||||
netPprofAddr := pflag.String("go-net-pprof-addr", "", "address to listen to for net/pprof requests")
|
netPprofAddr := pflag.String("go-net-pprof-addr", "", "address to listen to for net/pprof requests")
|
||||||
cpuProfile := pflag.String("go-profile-cpu", "", "file to write cpu profile to")
|
cpuProfile := pflag.String("go-profile-cpu", "", "file to write cpu profile to")
|
||||||
@@ -72,4 +83,65 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer belt.Flush(ctx)
|
defer belt.Flush(ctx)
|
||||||
|
|
||||||
|
dataPath, err := xpath.Expand(*configPath)
|
||||||
|
if err != nil {
|
||||||
|
l.Fatalf("unable to get the path to the data file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
var cancelFunc context.CancelFunc
|
||||||
|
var _ui uiiface.UI
|
||||||
|
|
||||||
|
restart := func() {
|
||||||
|
l.Debugf("restart()")
|
||||||
|
if cancelFunc != nil {
|
||||||
|
l.Infof("cancelling the old server")
|
||||||
|
cancelFunc()
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
|
defer wg.Done()
|
||||||
|
l.Infof("starting a server")
|
||||||
|
|
||||||
|
ctx, _cancelFunc := context.WithCancel(ctx)
|
||||||
|
cancelFunc = _cancelFunc
|
||||||
|
|
||||||
|
streamD, err := streamd.New(dataPath, _ui, belt.CtxBelt(ctx))
|
||||||
|
if err != nil {
|
||||||
|
l.Fatalf("unable to initialize the streamd instance: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = streamD.Run(ctx); err != nil {
|
||||||
|
l.Fatalf("streamd exited with error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
listener, err := net.Listen("tcp", *listenAddr)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to listen: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
listener.Close()
|
||||||
|
}()
|
||||||
|
|
||||||
|
grpcServer := grpc.NewServer()
|
||||||
|
streamd_grpc.RegisterStreamDServer(grpcServer, server.NewGRPCServer(streamD))
|
||||||
|
l.Infof("started server at %s", *listenAddr)
|
||||||
|
err = grpcServer.Serve(listener)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_ui = ui.NewUI(
|
||||||
|
ctx,
|
||||||
|
func(ctx context.Context, s string) {
|
||||||
|
restart()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
restart()
|
||||||
|
<-ctx.Done()
|
||||||
}
|
}
|
||||||
|
85
cmd/streamd/ui/ui.go
Normal file
85
cmd/streamd/ui/ui.go
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
package ui
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/facebookincubator/go-belt"
|
||||||
|
"github.com/facebookincubator/go-belt/tool/logger"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
obs "github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs/types"
|
||||||
|
twitch "github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch/types"
|
||||||
|
youtube "github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube/types"
|
||||||
|
streamd "github.com/xaionaro-go/streamctl/pkg/streamd/types"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamd/ui"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UI struct {
|
||||||
|
Belt *belt.Belt
|
||||||
|
RestartFn func(context.Context, string)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ ui.UI = (*UI)(nil)
|
||||||
|
|
||||||
|
func NewUI(
|
||||||
|
ctx context.Context,
|
||||||
|
restartFn func(context.Context, string),
|
||||||
|
) *UI {
|
||||||
|
return &UI{
|
||||||
|
Belt: belt.CtxBelt(ctx),
|
||||||
|
RestartFn: restartFn,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ui *UI) SetStatus(msg string) {
|
||||||
|
logger.FromBelt(ui.Belt).Infof("status: %s", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ui *UI) DisplayError(err error) {
|
||||||
|
logger.FromBelt(ui.Belt).Errorf("error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ui *UI) Restart(ctx context.Context, msg string) {
|
||||||
|
ui.RestartFn(ctx, msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) InputGitUserData(
|
||||||
|
ctx context.Context,
|
||||||
|
) (bool, string, []byte, error) {
|
||||||
|
return false, "", nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) OAuthHandlerTwitch(
|
||||||
|
ctx context.Context,
|
||||||
|
arg oauthhandler.OAuthHandlerArgument,
|
||||||
|
) error {
|
||||||
|
return oauthhandler.OAuth2HandlerViaCLI(ctx, arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) OAuthHandlerYouTube(
|
||||||
|
ctx context.Context,
|
||||||
|
arg oauthhandler.OAuthHandlerArgument,
|
||||||
|
) error {
|
||||||
|
return oauthhandler.OAuth2HandlerViaCLI(ctx, arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) InputTwitchUserInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[twitch.PlatformSpecificConfig, twitch.StreamProfile],
|
||||||
|
) (bool, error) {
|
||||||
|
return false, streamd.ErrSkipBackend
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) InputYouTubeUserInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[youtube.PlatformSpecificConfig, youtube.StreamProfile],
|
||||||
|
) (bool, error) {
|
||||||
|
return false, streamd.ErrSkipBackend
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UI) InputOBSConnectInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[obs.PlatformSpecificConfig, obs.StreamProfile],
|
||||||
|
) (bool, error) {
|
||||||
|
return false, streamd.ErrSkipBackend
|
||||||
|
}
|
6
go.mod
6
go.mod
@@ -37,7 +37,6 @@ require (
|
|||||||
github.com/go-text/render v0.1.0 // indirect
|
github.com/go-text/render v0.1.0 // indirect
|
||||||
github.com/go-text/typesetting v0.1.0 // indirect
|
github.com/go-text/typesetting v0.1.0 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||||
github.com/google/go-querystring v1.1.0 // indirect
|
|
||||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||||
github.com/gorilla/websocket v1.5.2 // indirect
|
github.com/gorilla/websocket v1.5.2 // indirect
|
||||||
github.com/hashicorp/logutils v1.0.0 // indirect
|
github.com/hashicorp/logutils v1.0.0 // indirect
|
||||||
@@ -86,7 +85,6 @@ require (
|
|||||||
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect
|
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.4 // indirect
|
github.com/golang/protobuf v1.5.4 // indirect
|
||||||
github.com/google/go-github/v62 v62.0.0
|
|
||||||
github.com/google/s2a-go v0.1.7 // indirect
|
github.com/google/s2a-go v0.1.7 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||||
@@ -113,6 +111,6 @@ require (
|
|||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||||
google.golang.org/appengine v1.6.8 // indirect
|
google.golang.org/appengine v1.6.8 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415141817-7cd4c1c1f9ec // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415141817-7cd4c1c1f9ec // indirect
|
||||||
google.golang.org/grpc v1.63.2 // indirect
|
google.golang.org/grpc v1.63.2
|
||||||
google.golang.org/protobuf v1.33.0 // indirect
|
google.golang.org/protobuf v1.33.0
|
||||||
)
|
)
|
||||||
|
6
go.sum
6
go.sum
@@ -224,10 +224,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
|
|
||||||
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
|
|
||||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
|
||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
@@ -556,8 +552,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
|||||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||||
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
|
|
||||||
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
|
||||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
@@ -2,24 +2,15 @@ package obs
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
obs "github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ID = streamctl.PlatformName("obs")
|
const ID = obs.ID
|
||||||
|
|
||||||
type PlatformSpecificConfig struct {
|
type Config = obs.Config
|
||||||
Host string
|
type StreamProfile = obs.StreamProfile
|
||||||
Port uint16
|
type PlatformSpecificConfig = obs.PlatformSpecificConfig
|
||||||
Password string `yaml:"pass" json:"pass"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
|
||||||
|
|
||||||
func InitConfig(cfg streamctl.Config) {
|
func InitConfig(cfg streamctl.Config) {
|
||||||
streamctl.InitConfig(cfg, ID, Config{})
|
obs.InitConfig(cfg)
|
||||||
}
|
|
||||||
|
|
||||||
type StreamProfile struct {
|
|
||||||
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
|
||||||
|
|
||||||
EnableRecording bool `yaml:"enable_recording" json:"enable_recording"`
|
|
||||||
}
|
}
|
||||||
|
25
pkg/streamcontrol/obs/types/config.go
Normal file
25
pkg/streamcontrol/obs/types/config.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package obs
|
||||||
|
|
||||||
|
import (
|
||||||
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
)
|
||||||
|
|
||||||
|
const ID = streamctl.PlatformName("obs")
|
||||||
|
|
||||||
|
type PlatformSpecificConfig struct {
|
||||||
|
Host string
|
||||||
|
Port uint16
|
||||||
|
Password string `yaml:"pass" json:"pass"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
||||||
|
|
||||||
|
func InitConfig(cfg streamctl.Config) {
|
||||||
|
streamctl.InitConfig(cfg, ID, Config{})
|
||||||
|
}
|
||||||
|
|
||||||
|
type StreamProfile struct {
|
||||||
|
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
||||||
|
|
||||||
|
EnableRecording bool `yaml:"enable_recording" json:"enable_recording"`
|
||||||
|
}
|
@@ -1,39 +1,17 @@
|
|||||||
package twitch
|
package twitch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
|
||||||
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
twitch "github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ID = streamctl.PlatformName("twitch")
|
const ID = twitch.ID
|
||||||
|
|
||||||
type OAuthHandler func(context.Context, oauthhandler.OAuthHandlerArgument) error
|
type Config = twitch.Config
|
||||||
|
type StreamProfile = twitch.StreamProfile
|
||||||
type PlatformSpecificConfig struct {
|
type PlatformSpecificConfig = twitch.PlatformSpecificConfig
|
||||||
Channel string
|
type OAuthHandler = twitch.OAuthHandler
|
||||||
ClientID string
|
|
||||||
ClientSecret string
|
|
||||||
ClientCode string
|
|
||||||
AuthType string
|
|
||||||
AppAccessToken string
|
|
||||||
UserAccessToken string
|
|
||||||
RefreshToken string
|
|
||||||
CustomOAuthHandler OAuthHandler `yaml:"-"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
|
||||||
|
|
||||||
func InitConfig(cfg streamctl.Config) {
|
func InitConfig(cfg streamctl.Config) {
|
||||||
streamctl.InitConfig(cfg, ID, Config{})
|
twitch.InitConfig(cfg)
|
||||||
}
|
|
||||||
|
|
||||||
type StreamProfile struct {
|
|
||||||
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
|
||||||
|
|
||||||
Tags [10]string
|
|
||||||
Language *string
|
|
||||||
CategoryName *string
|
|
||||||
CategoryID *string
|
|
||||||
}
|
}
|
||||||
|
39
pkg/streamcontrol/twitch/types/config.go
Normal file
39
pkg/streamcontrol/twitch/types/config.go
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package twitch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
||||||
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
)
|
||||||
|
|
||||||
|
const ID = streamctl.PlatformName("twitch")
|
||||||
|
|
||||||
|
type OAuthHandler func(context.Context, oauthhandler.OAuthHandlerArgument) error
|
||||||
|
|
||||||
|
type PlatformSpecificConfig struct {
|
||||||
|
Channel string
|
||||||
|
ClientID string
|
||||||
|
ClientSecret string
|
||||||
|
ClientCode string
|
||||||
|
AuthType string
|
||||||
|
AppAccessToken string
|
||||||
|
UserAccessToken string
|
||||||
|
RefreshToken string
|
||||||
|
CustomOAuthHandler OAuthHandler `yaml:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
||||||
|
|
||||||
|
func InitConfig(cfg streamctl.Config) {
|
||||||
|
streamctl.InitConfig(cfg, ID, Config{})
|
||||||
|
}
|
||||||
|
|
||||||
|
type StreamProfile struct {
|
||||||
|
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
||||||
|
|
||||||
|
Tags [10]string
|
||||||
|
Language *string
|
||||||
|
CategoryName *string
|
||||||
|
CategoryID *string
|
||||||
|
}
|
@@ -1,34 +1,17 @@
|
|||||||
package youtube
|
package youtube
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
|
||||||
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
"golang.org/x/oauth2"
|
youtube "github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ID = streamctl.PlatformName("youtube")
|
const ID = youtube.ID
|
||||||
|
|
||||||
type OAuthHandler func(context.Context, oauthhandler.OAuthHandlerArgument) error
|
type OAuthHandler = youtube.OAuthHandler
|
||||||
|
type Config = youtube.Config
|
||||||
type PlatformSpecificConfig struct {
|
type StreamProfile = youtube.StreamProfile
|
||||||
ClientID string
|
type PlatformSpecificConfig = youtube.PlatformSpecificConfig
|
||||||
ClientSecret string
|
|
||||||
Token *oauth2.Token
|
|
||||||
CustomOAuthHandler OAuthHandler `yaml:"-"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
|
||||||
|
|
||||||
func InitConfig(cfg streamctl.Config) {
|
func InitConfig(cfg streamctl.Config) {
|
||||||
streamctl.InitConfig(cfg, ID, Config{})
|
youtube.InitConfig(cfg)
|
||||||
}
|
|
||||||
|
|
||||||
type StreamProfile struct {
|
|
||||||
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
|
||||||
|
|
||||||
AutoNumerate bool
|
|
||||||
TemplateBroadcastIDs []string
|
|
||||||
Tags []string
|
|
||||||
}
|
}
|
||||||
|
34
pkg/streamcontrol/youtube/types/config.go
Normal file
34
pkg/streamcontrol/youtube/types/config.go
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package youtube
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
||||||
|
streamctl "github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
"golang.org/x/oauth2"
|
||||||
|
)
|
||||||
|
|
||||||
|
const ID = streamctl.PlatformName("youtube")
|
||||||
|
|
||||||
|
type OAuthHandler func(context.Context, oauthhandler.OAuthHandlerArgument) error
|
||||||
|
|
||||||
|
type PlatformSpecificConfig struct {
|
||||||
|
ClientID string
|
||||||
|
ClientSecret string
|
||||||
|
Token *oauth2.Token
|
||||||
|
CustomOAuthHandler OAuthHandler `yaml:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config = streamctl.PlatformConfig[PlatformSpecificConfig, StreamProfile]
|
||||||
|
|
||||||
|
func InitConfig(cfg streamctl.Config) {
|
||||||
|
streamctl.InitConfig(cfg, ID, Config{})
|
||||||
|
}
|
||||||
|
|
||||||
|
type StreamProfile struct {
|
||||||
|
streamctl.StreamProfileBase `yaml:",omitempty,inline,alias"`
|
||||||
|
|
||||||
|
AutoNumerate bool
|
||||||
|
TemplateBroadcastIDs []string
|
||||||
|
Tags []string
|
||||||
|
}
|
@@ -9,19 +9,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type StreamD interface {
|
type StreamD interface {
|
||||||
|
Run(ctx context.Context) error
|
||||||
FetchConfig(ctx context.Context) error
|
FetchConfig(ctx context.Context) error
|
||||||
ResetCache(ctx context.Context) error
|
ResetCache(ctx context.Context) error
|
||||||
InitCache(ctx context.Context) error
|
InitCache(ctx context.Context) error
|
||||||
SetPlatformConfig(
|
|
||||||
ctx context.Context,
|
|
||||||
platID streamcontrol.PlatformName,
|
|
||||||
platCfg *streamcontrol.AbstractPlatformConfig,
|
|
||||||
) error
|
|
||||||
SaveConfig(ctx context.Context) error
|
SaveConfig(ctx context.Context) error
|
||||||
GetConfig(ctx context.Context) (*config.Config, error)
|
GetConfig(ctx context.Context) (*config.Config, error)
|
||||||
SetConfig(ctx context.Context, cfg *config.Config) error
|
SetConfig(ctx context.Context, cfg *config.Config) error
|
||||||
IsBackendEnabled(ctx context.Context, id streamcontrol.PlatformName) (bool, error)
|
IsBackendEnabled(ctx context.Context, id streamcontrol.PlatformName) (bool, error)
|
||||||
IsGITInitialized(ctx context.Context) (bool, error)
|
OBSOLETE_IsGITInitialized(ctx context.Context) (bool, error)
|
||||||
StartStream(
|
StartStream(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
platID streamcontrol.PlatformName,
|
platID streamcontrol.PlatformName,
|
||||||
@@ -30,9 +26,10 @@ type StreamD interface {
|
|||||||
customArgs ...any,
|
customArgs ...any,
|
||||||
) error
|
) error
|
||||||
EndStream(ctx context.Context, platID streamcontrol.PlatformName) error
|
EndStream(ctx context.Context, platID streamcontrol.PlatformName) error
|
||||||
GitRelogin(ctx context.Context) error
|
OBSOLETE_GitRelogin(ctx context.Context) error
|
||||||
GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error)
|
GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error)
|
||||||
Restart(ctx context.Context) error
|
Restart(ctx context.Context) error
|
||||||
|
EXPERIMENTAL_ReinitStreamControllers(ctx context.Context) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type BackendDataOBS struct{}
|
type BackendDataOBS struct{}
|
||||||
|
@@ -7,6 +7,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
obs "github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs/types"
|
||||||
|
twitch "github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch/types"
|
||||||
|
youtube "github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube/types"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamd/api"
|
"github.com/xaionaro-go/streamctl/pkg/streamd/api"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamd/config"
|
"github.com/xaionaro-go/streamctl/pkg/streamd/config"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamd/grpc/go/streamd_grpc"
|
"github.com/xaionaro-go/streamctl/pkg/streamd/grpc/go/streamd_grpc"
|
||||||
@@ -33,6 +36,10 @@ func (c *Client) grpcClient() (streamd_grpc.StreamDClient, *grpc.ClientConn, err
|
|||||||
return client, conn, nil
|
return client, conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) Run(ctx context.Context) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Client) FetchConfig(ctx context.Context) error {
|
func (c *Client) FetchConfig(ctx context.Context) error {
|
||||||
client, conn, err := c.grpcClient()
|
client, conn, err := c.grpcClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -55,14 +62,6 @@ func (c *Client) InitCache(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SetPlatformConfig(
|
|
||||||
ctx context.Context,
|
|
||||||
platID streamcontrol.PlatformName,
|
|
||||||
platCfg *streamcontrol.AbstractPlatformConfig,
|
|
||||||
) error {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) SaveConfig(ctx context.Context) error {
|
func (c *Client) SaveConfig(ctx context.Context) error {
|
||||||
client, conn, err := c.grpcClient()
|
client, conn, err := c.grpcClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -96,12 +95,13 @@ func (c *Client) GetConfig(ctx context.Context) (*config.Config, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to request the config: %w", err)
|
return nil, fmt.Errorf("unable to request the config: %w", err)
|
||||||
}
|
}
|
||||||
var config config.Config
|
|
||||||
err = json.Unmarshal([]byte(reply.Config), &config)
|
var result config.Config
|
||||||
|
err = config.ReadConfig(ctx, []byte(reply.Config), &result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to unserialize the received config: %w", err)
|
return nil, fmt.Errorf("unable to unserialize the received config: %w", err)
|
||||||
}
|
}
|
||||||
return &config, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SetConfig(ctx context.Context, cfg *config.Config) error {
|
func (c *Client) SetConfig(ctx context.Context, cfg *config.Config) error {
|
||||||
@@ -140,7 +140,7 @@ func (c *Client) IsBackendEnabled(ctx context.Context, id streamcontrol.Platform
|
|||||||
return reply.IsInitialized, nil
|
return reply.IsInitialized, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) IsGITInitialized(ctx context.Context) (bool, error) {
|
func (c *Client) OBSOLETE_IsGITInitialized(ctx context.Context) (bool, error) {
|
||||||
client, conn, err := c.grpcClient()
|
client, conn, err := c.grpcClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
@@ -199,7 +199,7 @@ func (c *Client) EndStream(ctx context.Context, platID streamcontrol.PlatformNam
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GitRelogin(ctx context.Context) error {
|
func (c *Client) OBSOLETE_GitRelogin(ctx context.Context) error {
|
||||||
client, conn, err := c.grpcClient()
|
client, conn, err := c.grpcClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -215,7 +215,36 @@ func (c *Client) GitRelogin(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error) {
|
func (c *Client) GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error) {
|
||||||
panic("not implemented")
|
client, conn, err := c.grpcClient()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
reply, err := client.GetBackendInfo(ctx, &streamd_grpc.GetBackendInfoRequest{
|
||||||
|
PlatID: string(platID),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to get backend info: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var data any
|
||||||
|
switch platID {
|
||||||
|
case obs.ID:
|
||||||
|
data = &api.BackendDataOBS{}
|
||||||
|
case twitch.ID:
|
||||||
|
data = &api.BackendDataTwitch{}
|
||||||
|
case youtube.ID:
|
||||||
|
data = &api.BackendDataYouTube{}
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("unknown platform: '%s'", platID)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = json.Unmarshal([]byte(reply.GetData()), data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to deserialize data: %w", err)
|
||||||
|
}
|
||||||
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Restart(ctx context.Context) error {
|
func (c *Client) Restart(ctx context.Context) error {
|
||||||
@@ -232,3 +261,19 @@ func (c *Client) Restart(ctx context.Context) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) EXPERIMENTAL_ReinitStreamControllers(ctx context.Context) error {
|
||||||
|
client, conn, err := c.grpcClient()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
_, err = client.EXPERIMENTAL_ReinitStreamControllers(ctx, &streamd_grpc.EXPERIMENTAL_ReinitStreamControllersRequest{})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable restart the server: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -223,7 +223,7 @@ func (d *StreamD) startPeriodicGitSyncer(ctx context.Context) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *StreamD) GitRelogin(ctx context.Context) error {
|
func (d *StreamD) OBSOLETE_GitRelogin(ctx context.Context) error {
|
||||||
alreadyLoggedIn := d.GitStorage != nil
|
alreadyLoggedIn := d.GitStorage != nil
|
||||||
oldCfg := d.Config.GitRepo
|
oldCfg := d.Config.GitRepo
|
||||||
d.Config.GitRepo = config.GitRepoConfig{}
|
d.Config.GitRepo = config.GitRepoConfig{}
|
||||||
|
@@ -790,6 +790,82 @@ func (*RestartReply) Descriptor() ([]byte, []int) {
|
|||||||
return file_streamd_proto_rawDescGZIP(), []int{17}
|
return file_streamd_proto_rawDescGZIP(), []int{17}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EXPERIMENTAL_ReinitStreamControllersRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersRequest) Reset() {
|
||||||
|
*x = EXPERIMENTAL_ReinitStreamControllersRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_streamd_proto_msgTypes[18]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*EXPERIMENTAL_ReinitStreamControllersRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_streamd_proto_msgTypes[18]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use EXPERIMENTAL_ReinitStreamControllersRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*EXPERIMENTAL_ReinitStreamControllersRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_streamd_proto_rawDescGZIP(), []int{18}
|
||||||
|
}
|
||||||
|
|
||||||
|
type EXPERIMENTAL_ReinitStreamControllersReply struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersReply) Reset() {
|
||||||
|
*x = EXPERIMENTAL_ReinitStreamControllersReply{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_streamd_proto_msgTypes[19]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersReply) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*EXPERIMENTAL_ReinitStreamControllersReply) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *EXPERIMENTAL_ReinitStreamControllersReply) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_streamd_proto_msgTypes[19]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use EXPERIMENTAL_ReinitStreamControllersReply.ProtoReflect.Descriptor instead.
|
||||||
|
func (*EXPERIMENTAL_ReinitStreamControllersReply) Descriptor() ([]byte, []int) {
|
||||||
|
return file_streamd_proto_rawDescGZIP(), []int{19}
|
||||||
|
}
|
||||||
|
|
||||||
type OBSOLETE_FetchConfigRequest struct {
|
type OBSOLETE_FetchConfigRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -799,7 +875,7 @@ type OBSOLETE_FetchConfigRequest struct {
|
|||||||
func (x *OBSOLETE_FetchConfigRequest) Reset() {
|
func (x *OBSOLETE_FetchConfigRequest) Reset() {
|
||||||
*x = OBSOLETE_FetchConfigRequest{}
|
*x = OBSOLETE_FetchConfigRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[18]
|
mi := &file_streamd_proto_msgTypes[20]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -812,7 +888,7 @@ func (x *OBSOLETE_FetchConfigRequest) String() string {
|
|||||||
func (*OBSOLETE_FetchConfigRequest) ProtoMessage() {}
|
func (*OBSOLETE_FetchConfigRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_FetchConfigRequest) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_FetchConfigRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[18]
|
mi := &file_streamd_proto_msgTypes[20]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -825,7 +901,7 @@ func (x *OBSOLETE_FetchConfigRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_FetchConfigRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_FetchConfigRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_FetchConfigRequest) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_FetchConfigRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{18}
|
return file_streamd_proto_rawDescGZIP(), []int{20}
|
||||||
}
|
}
|
||||||
|
|
||||||
type OBSOLETE_FetchConfigReply struct {
|
type OBSOLETE_FetchConfigReply struct {
|
||||||
@@ -837,7 +913,7 @@ type OBSOLETE_FetchConfigReply struct {
|
|||||||
func (x *OBSOLETE_FetchConfigReply) Reset() {
|
func (x *OBSOLETE_FetchConfigReply) Reset() {
|
||||||
*x = OBSOLETE_FetchConfigReply{}
|
*x = OBSOLETE_FetchConfigReply{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[19]
|
mi := &file_streamd_proto_msgTypes[21]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -850,7 +926,7 @@ func (x *OBSOLETE_FetchConfigReply) String() string {
|
|||||||
func (*OBSOLETE_FetchConfigReply) ProtoMessage() {}
|
func (*OBSOLETE_FetchConfigReply) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_FetchConfigReply) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_FetchConfigReply) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[19]
|
mi := &file_streamd_proto_msgTypes[21]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -863,7 +939,7 @@ func (x *OBSOLETE_FetchConfigReply) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_FetchConfigReply.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_FetchConfigReply.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_FetchConfigReply) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_FetchConfigReply) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{19}
|
return file_streamd_proto_rawDescGZIP(), []int{21}
|
||||||
}
|
}
|
||||||
|
|
||||||
type OBSOLETE_GetGitInfoRequest struct {
|
type OBSOLETE_GetGitInfoRequest struct {
|
||||||
@@ -875,7 +951,7 @@ type OBSOLETE_GetGitInfoRequest struct {
|
|||||||
func (x *OBSOLETE_GetGitInfoRequest) Reset() {
|
func (x *OBSOLETE_GetGitInfoRequest) Reset() {
|
||||||
*x = OBSOLETE_GetGitInfoRequest{}
|
*x = OBSOLETE_GetGitInfoRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[20]
|
mi := &file_streamd_proto_msgTypes[22]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -888,7 +964,7 @@ func (x *OBSOLETE_GetGitInfoRequest) String() string {
|
|||||||
func (*OBSOLETE_GetGitInfoRequest) ProtoMessage() {}
|
func (*OBSOLETE_GetGitInfoRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_GetGitInfoRequest) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_GetGitInfoRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[20]
|
mi := &file_streamd_proto_msgTypes[22]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -901,7 +977,7 @@ func (x *OBSOLETE_GetGitInfoRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_GetGitInfoRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_GetGitInfoRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_GetGitInfoRequest) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_GetGitInfoRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{20}
|
return file_streamd_proto_rawDescGZIP(), []int{22}
|
||||||
}
|
}
|
||||||
|
|
||||||
type OBSOLETE_GetGitInfoReply struct {
|
type OBSOLETE_GetGitInfoReply struct {
|
||||||
@@ -915,7 +991,7 @@ type OBSOLETE_GetGitInfoReply struct {
|
|||||||
func (x *OBSOLETE_GetGitInfoReply) Reset() {
|
func (x *OBSOLETE_GetGitInfoReply) Reset() {
|
||||||
*x = OBSOLETE_GetGitInfoReply{}
|
*x = OBSOLETE_GetGitInfoReply{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[21]
|
mi := &file_streamd_proto_msgTypes[23]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -928,7 +1004,7 @@ func (x *OBSOLETE_GetGitInfoReply) String() string {
|
|||||||
func (*OBSOLETE_GetGitInfoReply) ProtoMessage() {}
|
func (*OBSOLETE_GetGitInfoReply) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_GetGitInfoReply) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_GetGitInfoReply) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[21]
|
mi := &file_streamd_proto_msgTypes[23]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -941,7 +1017,7 @@ func (x *OBSOLETE_GetGitInfoReply) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_GetGitInfoReply.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_GetGitInfoReply.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_GetGitInfoReply) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_GetGitInfoReply) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{21}
|
return file_streamd_proto_rawDescGZIP(), []int{23}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *OBSOLETE_GetGitInfoReply) GetIsInitialized() bool {
|
func (x *OBSOLETE_GetGitInfoReply) GetIsInitialized() bool {
|
||||||
@@ -960,7 +1036,7 @@ type OBSOLETE_GitReloginRequest struct {
|
|||||||
func (x *OBSOLETE_GitReloginRequest) Reset() {
|
func (x *OBSOLETE_GitReloginRequest) Reset() {
|
||||||
*x = OBSOLETE_GitReloginRequest{}
|
*x = OBSOLETE_GitReloginRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[22]
|
mi := &file_streamd_proto_msgTypes[24]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -973,7 +1049,7 @@ func (x *OBSOLETE_GitReloginRequest) String() string {
|
|||||||
func (*OBSOLETE_GitReloginRequest) ProtoMessage() {}
|
func (*OBSOLETE_GitReloginRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_GitReloginRequest) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_GitReloginRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[22]
|
mi := &file_streamd_proto_msgTypes[24]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -986,7 +1062,7 @@ func (x *OBSOLETE_GitReloginRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_GitReloginRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_GitReloginRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_GitReloginRequest) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_GitReloginRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{22}
|
return file_streamd_proto_rawDescGZIP(), []int{24}
|
||||||
}
|
}
|
||||||
|
|
||||||
type OBSOLETE_GitReloginReply struct {
|
type OBSOLETE_GitReloginReply struct {
|
||||||
@@ -998,7 +1074,7 @@ type OBSOLETE_GitReloginReply struct {
|
|||||||
func (x *OBSOLETE_GitReloginReply) Reset() {
|
func (x *OBSOLETE_GitReloginReply) Reset() {
|
||||||
*x = OBSOLETE_GitReloginReply{}
|
*x = OBSOLETE_GitReloginReply{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_streamd_proto_msgTypes[23]
|
mi := &file_streamd_proto_msgTypes[25]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1087,7 @@ func (x *OBSOLETE_GitReloginReply) String() string {
|
|||||||
func (*OBSOLETE_GitReloginReply) ProtoMessage() {}
|
func (*OBSOLETE_GitReloginReply) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *OBSOLETE_GitReloginReply) ProtoReflect() protoreflect.Message {
|
func (x *OBSOLETE_GitReloginReply) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_streamd_proto_msgTypes[23]
|
mi := &file_streamd_proto_msgTypes[25]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1024,7 +1100,7 @@ func (x *OBSOLETE_GitReloginReply) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use OBSOLETE_GitReloginReply.ProtoReflect.Descriptor instead.
|
// Deprecated: Use OBSOLETE_GitReloginReply.ProtoReflect.Descriptor instead.
|
||||||
func (*OBSOLETE_GitReloginReply) Descriptor() ([]byte, []int) {
|
func (*OBSOLETE_GitReloginReply) Descriptor() ([]byte, []int) {
|
||||||
return file_streamd_proto_rawDescGZIP(), []int{23}
|
return file_streamd_proto_rawDescGZIP(), []int{25}
|
||||||
}
|
}
|
||||||
|
|
||||||
var File_streamd_proto protoreflect.FileDescriptor
|
var File_streamd_proto protoreflect.FileDescriptor
|
||||||
@@ -1069,68 +1145,82 @@ var file_streamd_proto_rawDesc = []byte{
|
|||||||
0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74,
|
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x74, 0x61,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x74, 0x61,
|
||||||
0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x42, 0x53, 0x4f, 0x4c,
|
0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2d, 0x0a, 0x2b, 0x45, 0x58, 0x50, 0x45, 0x52,
|
||||||
0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
|
0x49, 0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x65, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x74,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1b, 0x0a, 0x19, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45,
|
0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x73, 0x52,
|
||||||
0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2b, 0x0a, 0x29, 0x45, 0x58, 0x50, 0x45, 0x52, 0x49,
|
||||||
0x70, 0x6c, 0x79, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f,
|
0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x65, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x72,
|
||||||
0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65,
|
||||||
0x74, 0x22, 0x40, 0x0a, 0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65,
|
0x70, 0x6c, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f,
|
||||||
0x74, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a,
|
0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01,
|
0x73, 0x74, 0x22, 0x1b, 0x0a, 0x19, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46,
|
||||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69,
|
0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
|
||||||
0x7a, 0x65, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f,
|
0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, 0x47,
|
||||||
0x47, 0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x40, 0x0a,
|
||||||
0x74, 0x22, 0x1a, 0x0a, 0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69,
|
0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74,
|
||||||
0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xdc, 0x05,
|
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x73, 0x49,
|
||||||
0x0a, 0x07, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x44, 0x12, 0x31, 0x0a, 0x09, 0x47, 0x65, 0x74,
|
0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66,
|
0x52, 0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22,
|
||||||
0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x43,
|
0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52,
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09,
|
0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1a, 0x0a,
|
||||||
0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x11, 0x2e, 0x53, 0x65, 0x74, 0x43,
|
0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65, 0x6c,
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53,
|
0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe1, 0x06, 0x0a, 0x07, 0x53, 0x74,
|
||||||
0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12,
|
0x72, 0x65, 0x61, 0x6d, 0x44, 0x12, 0x31, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x34, 0x0a, 0x0a, 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x2e,
|
0x69, 0x67, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
|
||||||
0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x74, 0x1a, 0x10, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
|
0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43,
|
||||||
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61,
|
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x11, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x63, 0x68, 0x65, 0x12, 0x12, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65,
|
0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43,
|
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x53,
|
||||||
0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x49,
|
0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x2e, 0x53, 0x61, 0x76, 0x65,
|
||||||
0x6e, 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x11, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43,
|
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e,
|
||||||
0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x49, 0x6e,
|
0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
|
||||||
0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37,
|
0x00, 0x12, 0x34, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12,
|
||||||
0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x13, 0x2e,
|
0x12, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65,
|
||||||
0x73, 0x74, 0x1a, 0x11, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x49, 0x6e, 0x69, 0x74, 0x43,
|
||||||
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x45, 0x6e, 0x64, 0x53, 0x74,
|
0x61, 0x63, 0x68, 0x65, 0x12, 0x11, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65,
|
||||||
0x72, 0x65, 0x61, 0x6d, 0x12, 0x11, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x61,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72,
|
0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0b, 0x53, 0x74,
|
||||||
0x65, 0x61, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x47, 0x65,
|
0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x13, 0x2e, 0x53, 0x74, 0x61, 0x72,
|
||||||
0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47,
|
0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
|
||||||
0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
|
0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x70, 0x6c,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e,
|
0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||||
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07,
|
0x12, 0x11, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72,
|
0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52,
|
||||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61,
|
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63,
|
||||||
0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x14, 0x4f, 0x42, 0x53,
|
0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61,
|
||||||
0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x67, 0x12, 0x1c, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74,
|
0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66,
|
||||||
0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74,
|
||||||
0x1a, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68,
|
0x61, 0x72, 0x74, 0x12, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65,
|
||||||
0x10, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66,
|
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x82, 0x01, 0x0a, 0x24, 0x45, 0x58, 0x50, 0x45, 0x52, 0x49,
|
||||||
0x6f, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74,
|
0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x65, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x72,
|
||||||
0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
|
0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2c,
|
||||||
0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74,
|
0x2e, 0x45, 0x58, 0x50, 0x45, 0x52, 0x49, 0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x65,
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x13, 0x4f,
|
0x69, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
|
||||||
0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67,
|
0x6c, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x45,
|
||||||
0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69,
|
0x58, 0x50, 0x45, 0x52, 0x49, 0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x65, 0x69, 0x6e,
|
||||||
0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
0x69, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c,
|
||||||
0x19, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65,
|
0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x14, 0x4f, 0x42,
|
||||||
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f,
|
0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x67, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x62,
|
0x69, 0x67, 0x12, 0x1c, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65,
|
||||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
|
0x1a, 0x1a, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63,
|
||||||
|
0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4c,
|
||||||
|
0x0a, 0x10, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x49, 0x6e,
|
||||||
|
0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65,
|
||||||
|
0x74, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
|
0x19, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, 0x47, 0x69,
|
||||||
|
0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x13,
|
||||||
|
0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f,
|
||||||
|
0x67, 0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47,
|
||||||
|
0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
|
0x1a, 0x19, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52,
|
||||||
|
0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a,
|
||||||
|
0x0f, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x5f, 0x67, 0x72, 0x70, 0x63,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -1145,7 +1235,7 @@ func file_streamd_proto_rawDescGZIP() []byte {
|
|||||||
return file_streamd_proto_rawDescData
|
return file_streamd_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_streamd_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
|
var file_streamd_proto_msgTypes = make([]protoimpl.MessageInfo, 26)
|
||||||
var file_streamd_proto_goTypes = []interface{}{
|
var file_streamd_proto_goTypes = []interface{}{
|
||||||
(*GetConfigRequest)(nil), // 0: GetConfigRequest
|
(*GetConfigRequest)(nil), // 0: GetConfigRequest
|
||||||
(*GetConfigReply)(nil), // 1: GetConfigReply
|
(*GetConfigReply)(nil), // 1: GetConfigReply
|
||||||
@@ -1165,12 +1255,14 @@ var file_streamd_proto_goTypes = []interface{}{
|
|||||||
(*GetBackendInfoReply)(nil), // 15: GetBackendInfoReply
|
(*GetBackendInfoReply)(nil), // 15: GetBackendInfoReply
|
||||||
(*RestartRequest)(nil), // 16: RestartRequest
|
(*RestartRequest)(nil), // 16: RestartRequest
|
||||||
(*RestartReply)(nil), // 17: RestartReply
|
(*RestartReply)(nil), // 17: RestartReply
|
||||||
(*OBSOLETE_FetchConfigRequest)(nil), // 18: OBSOLETE_FetchConfigRequest
|
(*EXPERIMENTAL_ReinitStreamControllersRequest)(nil), // 18: EXPERIMENTAL_ReinitStreamControllersRequest
|
||||||
(*OBSOLETE_FetchConfigReply)(nil), // 19: OBSOLETE_FetchConfigReply
|
(*EXPERIMENTAL_ReinitStreamControllersReply)(nil), // 19: EXPERIMENTAL_ReinitStreamControllersReply
|
||||||
(*OBSOLETE_GetGitInfoRequest)(nil), // 20: OBSOLETE_GetGitInfoRequest
|
(*OBSOLETE_FetchConfigRequest)(nil), // 20: OBSOLETE_FetchConfigRequest
|
||||||
(*OBSOLETE_GetGitInfoReply)(nil), // 21: OBSOLETE_GetGitInfoReply
|
(*OBSOLETE_FetchConfigReply)(nil), // 21: OBSOLETE_FetchConfigReply
|
||||||
(*OBSOLETE_GitReloginRequest)(nil), // 22: OBSOLETE_GitReloginRequest
|
(*OBSOLETE_GetGitInfoRequest)(nil), // 22: OBSOLETE_GetGitInfoRequest
|
||||||
(*OBSOLETE_GitReloginReply)(nil), // 23: OBSOLETE_GitReloginReply
|
(*OBSOLETE_GetGitInfoReply)(nil), // 23: OBSOLETE_GetGitInfoReply
|
||||||
|
(*OBSOLETE_GitReloginRequest)(nil), // 24: OBSOLETE_GitReloginRequest
|
||||||
|
(*OBSOLETE_GitReloginReply)(nil), // 25: OBSOLETE_GitReloginReply
|
||||||
}
|
}
|
||||||
var file_streamd_proto_depIdxs = []int32{
|
var file_streamd_proto_depIdxs = []int32{
|
||||||
0, // 0: StreamD.GetConfig:input_type -> GetConfigRequest
|
0, // 0: StreamD.GetConfig:input_type -> GetConfigRequest
|
||||||
@@ -1182,23 +1274,25 @@ var file_streamd_proto_depIdxs = []int32{
|
|||||||
12, // 6: StreamD.EndStream:input_type -> EndStreamRequest
|
12, // 6: StreamD.EndStream:input_type -> EndStreamRequest
|
||||||
14, // 7: StreamD.GetBackendInfo:input_type -> GetBackendInfoRequest
|
14, // 7: StreamD.GetBackendInfo:input_type -> GetBackendInfoRequest
|
||||||
16, // 8: StreamD.Restart:input_type -> RestartRequest
|
16, // 8: StreamD.Restart:input_type -> RestartRequest
|
||||||
18, // 9: StreamD.OBSOLETE_FetchConfig:input_type -> OBSOLETE_FetchConfigRequest
|
18, // 9: StreamD.EXPERIMENTAL_ReinitStreamControllers:input_type -> EXPERIMENTAL_ReinitStreamControllersRequest
|
||||||
20, // 10: StreamD.OBSOLETE_GitInfo:input_type -> OBSOLETE_GetGitInfoRequest
|
20, // 10: StreamD.OBSOLETE_FetchConfig:input_type -> OBSOLETE_FetchConfigRequest
|
||||||
22, // 11: StreamD.OBSOLETE_GitRelogin:input_type -> OBSOLETE_GitReloginRequest
|
22, // 11: StreamD.OBSOLETE_GitInfo:input_type -> OBSOLETE_GetGitInfoRequest
|
||||||
1, // 12: StreamD.GetConfig:output_type -> GetConfigReply
|
24, // 12: StreamD.OBSOLETE_GitRelogin:input_type -> OBSOLETE_GitReloginRequest
|
||||||
3, // 13: StreamD.SetConfig:output_type -> SetConfigReply
|
1, // 13: StreamD.GetConfig:output_type -> GetConfigReply
|
||||||
5, // 14: StreamD.SaveConfig:output_type -> SaveConfigReply
|
3, // 14: StreamD.SetConfig:output_type -> SetConfigReply
|
||||||
7, // 15: StreamD.ResetCache:output_type -> ResetCacheReply
|
5, // 15: StreamD.SaveConfig:output_type -> SaveConfigReply
|
||||||
9, // 16: StreamD.InitCache:output_type -> InitCacheReply
|
7, // 16: StreamD.ResetCache:output_type -> ResetCacheReply
|
||||||
11, // 17: StreamD.StartStream:output_type -> StartStreamReply
|
9, // 17: StreamD.InitCache:output_type -> InitCacheReply
|
||||||
13, // 18: StreamD.EndStream:output_type -> EndStreamReply
|
11, // 18: StreamD.StartStream:output_type -> StartStreamReply
|
||||||
15, // 19: StreamD.GetBackendInfo:output_type -> GetBackendInfoReply
|
13, // 19: StreamD.EndStream:output_type -> EndStreamReply
|
||||||
17, // 20: StreamD.Restart:output_type -> RestartReply
|
15, // 20: StreamD.GetBackendInfo:output_type -> GetBackendInfoReply
|
||||||
19, // 21: StreamD.OBSOLETE_FetchConfig:output_type -> OBSOLETE_FetchConfigReply
|
17, // 21: StreamD.Restart:output_type -> RestartReply
|
||||||
21, // 22: StreamD.OBSOLETE_GitInfo:output_type -> OBSOLETE_GetGitInfoReply
|
19, // 22: StreamD.EXPERIMENTAL_ReinitStreamControllers:output_type -> EXPERIMENTAL_ReinitStreamControllersReply
|
||||||
23, // 23: StreamD.OBSOLETE_GitRelogin:output_type -> OBSOLETE_GitReloginReply
|
21, // 23: StreamD.OBSOLETE_FetchConfig:output_type -> OBSOLETE_FetchConfigReply
|
||||||
12, // [12:24] is the sub-list for method output_type
|
23, // 24: StreamD.OBSOLETE_GitInfo:output_type -> OBSOLETE_GetGitInfoReply
|
||||||
0, // [0:12] is the sub-list for method input_type
|
25, // 25: StreamD.OBSOLETE_GitRelogin:output_type -> OBSOLETE_GitReloginReply
|
||||||
|
13, // [13:26] is the sub-list for method output_type
|
||||||
|
0, // [0:13] is the sub-list for method input_type
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
0, // [0:0] is the sub-list for field type_name
|
0, // [0:0] is the sub-list for field type_name
|
||||||
@@ -1427,7 +1521,7 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_FetchConfigRequest); i {
|
switch v := v.(*EXPERIMENTAL_ReinitStreamControllersRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1439,7 +1533,7 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_FetchConfigReply); i {
|
switch v := v.(*EXPERIMENTAL_ReinitStreamControllersReply); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1451,7 +1545,7 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_GetGitInfoRequest); i {
|
switch v := v.(*OBSOLETE_FetchConfigRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1463,7 +1557,7 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_GetGitInfoReply); i {
|
switch v := v.(*OBSOLETE_FetchConfigReply); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1475,7 +1569,7 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_GitReloginRequest); i {
|
switch v := v.(*OBSOLETE_GetGitInfoRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1487,6 +1581,30 @@ func file_streamd_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_streamd_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
|
file_streamd_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*OBSOLETE_GetGitInfoReply); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_streamd_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*OBSOLETE_GitReloginRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_streamd_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*OBSOLETE_GitReloginReply); i {
|
switch v := v.(*OBSOLETE_GitReloginReply); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1505,7 +1623,7 @@ func file_streamd_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_streamd_proto_rawDesc,
|
RawDescriptor: file_streamd_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 24,
|
NumMessages: 26,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@@ -31,6 +31,7 @@ type StreamDClient interface {
|
|||||||
EndStream(ctx context.Context, in *EndStreamRequest, opts ...grpc.CallOption) (*EndStreamReply, error)
|
EndStream(ctx context.Context, in *EndStreamRequest, opts ...grpc.CallOption) (*EndStreamReply, error)
|
||||||
GetBackendInfo(ctx context.Context, in *GetBackendInfoRequest, opts ...grpc.CallOption) (*GetBackendInfoReply, error)
|
GetBackendInfo(ctx context.Context, in *GetBackendInfoRequest, opts ...grpc.CallOption) (*GetBackendInfoReply, error)
|
||||||
Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error)
|
Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error)
|
||||||
|
EXPERIMENTAL_ReinitStreamControllers(ctx context.Context, in *EXPERIMENTAL_ReinitStreamControllersRequest, opts ...grpc.CallOption) (*EXPERIMENTAL_ReinitStreamControllersReply, error)
|
||||||
OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error)
|
OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error)
|
||||||
OBSOLETE_GitInfo(ctx context.Context, in *OBSOLETE_GetGitInfoRequest, opts ...grpc.CallOption) (*OBSOLETE_GetGitInfoReply, error)
|
OBSOLETE_GitInfo(ctx context.Context, in *OBSOLETE_GetGitInfoRequest, opts ...grpc.CallOption) (*OBSOLETE_GetGitInfoReply, error)
|
||||||
OBSOLETE_GitRelogin(ctx context.Context, in *OBSOLETE_GitReloginRequest, opts ...grpc.CallOption) (*OBSOLETE_GitReloginReply, error)
|
OBSOLETE_GitRelogin(ctx context.Context, in *OBSOLETE_GitReloginRequest, opts ...grpc.CallOption) (*OBSOLETE_GitReloginReply, error)
|
||||||
@@ -125,6 +126,15 @@ func (c *streamDClient) Restart(ctx context.Context, in *RestartRequest, opts ..
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *streamDClient) EXPERIMENTAL_ReinitStreamControllers(ctx context.Context, in *EXPERIMENTAL_ReinitStreamControllersRequest, opts ...grpc.CallOption) (*EXPERIMENTAL_ReinitStreamControllersReply, error) {
|
||||||
|
out := new(EXPERIMENTAL_ReinitStreamControllersReply)
|
||||||
|
err := c.cc.Invoke(ctx, "/StreamD/EXPERIMENTAL_ReinitStreamControllers", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *streamDClient) OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error) {
|
func (c *streamDClient) OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error) {
|
||||||
out := new(OBSOLETE_FetchConfigReply)
|
out := new(OBSOLETE_FetchConfigReply)
|
||||||
err := c.cc.Invoke(ctx, "/StreamD/OBSOLETE_FetchConfig", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/StreamD/OBSOLETE_FetchConfig", in, out, opts...)
|
||||||
@@ -165,6 +175,7 @@ type StreamDServer interface {
|
|||||||
EndStream(context.Context, *EndStreamRequest) (*EndStreamReply, error)
|
EndStream(context.Context, *EndStreamRequest) (*EndStreamReply, error)
|
||||||
GetBackendInfo(context.Context, *GetBackendInfoRequest) (*GetBackendInfoReply, error)
|
GetBackendInfo(context.Context, *GetBackendInfoRequest) (*GetBackendInfoReply, error)
|
||||||
Restart(context.Context, *RestartRequest) (*RestartReply, error)
|
Restart(context.Context, *RestartRequest) (*RestartReply, error)
|
||||||
|
EXPERIMENTAL_ReinitStreamControllers(context.Context, *EXPERIMENTAL_ReinitStreamControllersRequest) (*EXPERIMENTAL_ReinitStreamControllersReply, error)
|
||||||
OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error)
|
OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error)
|
||||||
OBSOLETE_GitInfo(context.Context, *OBSOLETE_GetGitInfoRequest) (*OBSOLETE_GetGitInfoReply, error)
|
OBSOLETE_GitInfo(context.Context, *OBSOLETE_GetGitInfoRequest) (*OBSOLETE_GetGitInfoReply, error)
|
||||||
OBSOLETE_GitRelogin(context.Context, *OBSOLETE_GitReloginRequest) (*OBSOLETE_GitReloginReply, error)
|
OBSOLETE_GitRelogin(context.Context, *OBSOLETE_GitReloginRequest) (*OBSOLETE_GitReloginReply, error)
|
||||||
@@ -202,6 +213,9 @@ func (UnimplementedStreamDServer) GetBackendInfo(context.Context, *GetBackendInf
|
|||||||
func (UnimplementedStreamDServer) Restart(context.Context, *RestartRequest) (*RestartReply, error) {
|
func (UnimplementedStreamDServer) Restart(context.Context, *RestartRequest) (*RestartReply, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedStreamDServer) EXPERIMENTAL_ReinitStreamControllers(context.Context, *EXPERIMENTAL_ReinitStreamControllersRequest) (*EXPERIMENTAL_ReinitStreamControllersReply, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method EXPERIMENTAL_ReinitStreamControllers not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedStreamDServer) OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error) {
|
func (UnimplementedStreamDServer) OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OBSOLETE_FetchConfig not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OBSOLETE_FetchConfig not implemented")
|
||||||
}
|
}
|
||||||
@@ -386,6 +400,24 @@ func _StreamD_Restart_Handler(srv interface{}, ctx context.Context, dec func(int
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _StreamD_EXPERIMENTAL_ReinitStreamControllers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(EXPERIMENTAL_ReinitStreamControllersRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StreamDServer).EXPERIMENTAL_ReinitStreamControllers(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/StreamD/EXPERIMENTAL_ReinitStreamControllers",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StreamDServer).EXPERIMENTAL_ReinitStreamControllers(ctx, req.(*EXPERIMENTAL_ReinitStreamControllersRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _StreamD_OBSOLETE_FetchConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _StreamD_OBSOLETE_FetchConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OBSOLETE_FetchConfigRequest)
|
in := new(OBSOLETE_FetchConfigRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@@ -483,6 +515,10 @@ var StreamD_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "Restart",
|
MethodName: "Restart",
|
||||||
Handler: _StreamD_Restart_Handler,
|
Handler: _StreamD_Restart_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "EXPERIMENTAL_ReinitStreamControllers",
|
||||||
|
Handler: _StreamD_EXPERIMENTAL_ReinitStreamControllers_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "OBSOLETE_FetchConfig",
|
MethodName: "OBSOLETE_FetchConfig",
|
||||||
Handler: _StreamD_OBSOLETE_FetchConfig_Handler,
|
Handler: _StreamD_OBSOLETE_FetchConfig_Handler,
|
||||||
|
@@ -12,6 +12,8 @@ service StreamD {
|
|||||||
rpc GetBackendInfo(GetBackendInfoRequest) returns (GetBackendInfoReply) {}
|
rpc GetBackendInfo(GetBackendInfoRequest) returns (GetBackendInfoReply) {}
|
||||||
rpc Restart(RestartRequest) returns (RestartReply) {}
|
rpc Restart(RestartRequest) returns (RestartReply) {}
|
||||||
|
|
||||||
|
rpc EXPERIMENTAL_ReinitStreamControllers(EXPERIMENTAL_ReinitStreamControllersRequest) returns (EXPERIMENTAL_ReinitStreamControllersReply) {}
|
||||||
|
|
||||||
rpc OBSOLETE_FetchConfig(OBSOLETE_FetchConfigRequest) returns (OBSOLETE_FetchConfigReply) {}
|
rpc OBSOLETE_FetchConfig(OBSOLETE_FetchConfigRequest) returns (OBSOLETE_FetchConfigReply) {}
|
||||||
rpc OBSOLETE_GitInfo(OBSOLETE_GetGitInfoRequest) returns (OBSOLETE_GetGitInfoReply) {}
|
rpc OBSOLETE_GitInfo(OBSOLETE_GetGitInfoRequest) returns (OBSOLETE_GetGitInfoReply) {}
|
||||||
rpc OBSOLETE_GitRelogin(OBSOLETE_GitReloginRequest) returns (OBSOLETE_GitReloginReply) {}
|
rpc OBSOLETE_GitRelogin(OBSOLETE_GitReloginRequest) returns (OBSOLETE_GitReloginReply) {}
|
||||||
@@ -52,6 +54,9 @@ message GetBackendInfoReply {
|
|||||||
message RestartRequest {}
|
message RestartRequest {}
|
||||||
message RestartReply {}
|
message RestartReply {}
|
||||||
|
|
||||||
|
message EXPERIMENTAL_ReinitStreamControllersRequest {}
|
||||||
|
message EXPERIMENTAL_ReinitStreamControllersReply {}
|
||||||
|
|
||||||
message OBSOLETE_FetchConfigRequest {}
|
message OBSOLETE_FetchConfigRequest {}
|
||||||
message OBSOLETE_FetchConfigReply {}
|
message OBSOLETE_FetchConfigReply {}
|
||||||
message OBSOLETE_GetGitInfoRequest {}
|
message OBSOLETE_GetGitInfoRequest {}
|
||||||
|
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/goccy/go-yaml"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch"
|
||||||
@@ -48,13 +49,13 @@ func (grpc *GRPCServer) SetConfig(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *streamd_grpc.SetConfigRequest,
|
req *streamd_grpc.SetConfigRequest,
|
||||||
) (*streamd_grpc.SetConfigReply, error) {
|
) (*streamd_grpc.SetConfigReply, error) {
|
||||||
var config config.Config
|
var result config.Config
|
||||||
err := json.Unmarshal([]byte(req.Config), &config)
|
err := config.ReadConfig(ctx, []byte(req.Config), &result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to unserialize the config: %w", err)
|
return nil, fmt.Errorf("unable to unserialize the config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = grpc.StreamD.SetConfig(ctx, &config)
|
err = grpc.StreamD.SetConfig(ctx, &result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to set the config: %w", err)
|
return nil, fmt.Errorf("unable to set the config: %w", err)
|
||||||
}
|
}
|
||||||
@@ -112,7 +113,7 @@ func (grpc *GRPCServer) StartStream(
|
|||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unexpected platform ID: '%s'", platID)
|
return nil, fmt.Errorf("unexpected platform ID: '%s'", platID)
|
||||||
}
|
}
|
||||||
err = json.Unmarshal([]byte(req.GetProfile()), &profile)
|
err = yaml.Unmarshal([]byte(req.GetProfile()), &profile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to unserialize the profile: %w", err)
|
return nil, fmt.Errorf("unable to unserialize the profile: %w", err)
|
||||||
}
|
}
|
||||||
@@ -192,7 +193,7 @@ func (grpc *GRPCServer) OBSOLETE_GitInfo(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *streamd_grpc.OBSOLETE_GetGitInfoRequest,
|
req *streamd_grpc.OBSOLETE_GetGitInfoRequest,
|
||||||
) (*streamd_grpc.OBSOLETE_GetGitInfoReply, error) {
|
) (*streamd_grpc.OBSOLETE_GetGitInfoReply, error) {
|
||||||
isEnabled, err := grpc.StreamD.IsGITInitialized(ctx)
|
isEnabled, err := grpc.StreamD.OBSOLETE_IsGITInitialized(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to get the git info: %w", err)
|
return nil, fmt.Errorf("unable to get the git info: %w", err)
|
||||||
}
|
}
|
||||||
@@ -205,7 +206,7 @@ func (grpc *GRPCServer) OBSOLETE_GitRelogin(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *streamd_grpc.OBSOLETE_GitReloginRequest,
|
req *streamd_grpc.OBSOLETE_GitReloginRequest,
|
||||||
) (*streamd_grpc.OBSOLETE_GitReloginReply, error) {
|
) (*streamd_grpc.OBSOLETE_GitReloginReply, error) {
|
||||||
err := grpc.StreamD.GitRelogin(ctx)
|
err := grpc.StreamD.OBSOLETE_GitRelogin(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to relogin: %w", err)
|
return nil, fmt.Errorf("unable to relogin: %w", err)
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,45 @@
|
|||||||
package streampanel
|
package streamd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/facebookincubator/go-belt/tool/logger"
|
"github.com/facebookincubator/go-belt/tool/logger"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube"
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube"
|
||||||
"github.com/xaionaro-go/streamctl/pkg/streamd"
|
streamd "github.com/xaionaro-go/streamctl/pkg/streamd/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrSkipBackend = errors.New("backend was skipped")
|
func (d *StreamD) EXPERIMENTAL_ReinitStreamControllers(ctx context.Context) error {
|
||||||
|
platNames := make([]streamcontrol.PlatformName, 0, len(d.Config.Backends))
|
||||||
|
for platName := range d.Config.Backends {
|
||||||
|
platNames = append(platNames, platName)
|
||||||
|
}
|
||||||
|
sort.Slice(platNames, func(i, j int) bool {
|
||||||
|
return platNames[i] < platNames[j]
|
||||||
|
})
|
||||||
|
for _, platName := range platNames {
|
||||||
|
var err error
|
||||||
|
switch strings.ToLower(string(platName)) {
|
||||||
|
case strings.ToLower(string(obs.ID)):
|
||||||
|
err = d.initOBSBackend(ctx)
|
||||||
|
case strings.ToLower(string(twitch.ID)):
|
||||||
|
err = d.initTwitchBackend(ctx)
|
||||||
|
case strings.ToLower(string(youtube.ID)):
|
||||||
|
err = d.initYouTubeBackend(ctx)
|
||||||
|
}
|
||||||
|
if err != nil && err != ErrSkipBackend {
|
||||||
|
return fmt.Errorf("unable to initialize '%s': %w", platName, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var ErrSkipBackend = streamd.ErrSkipBackend
|
||||||
|
|
||||||
func newOBS(
|
func newOBS(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@@ -201,51 +227,51 @@ func newYouTube(
|
|||||||
return yt, nil
|
return yt, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) initOBSBackend(ctx context.Context) error {
|
func (d *StreamD) initOBSBackend(ctx context.Context) error {
|
||||||
obs, err := newOBS(
|
obs, err := newOBS(
|
||||||
ctx,
|
ctx,
|
||||||
p.StreamD.(*streamd.StreamD).Config.Backends[obs.ID],
|
d.Config.Backends[obs.ID],
|
||||||
p.inputOBSConnectInfo,
|
d.UI.InputOBSConnectInfo,
|
||||||
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
||||||
return p.savePlatformConfig(ctx, obs.ID, cfg)
|
return d.setPlatformConfig(ctx, obs.ID, cfg)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
p.StreamD.(*streamd.StreamD).StreamControllers.OBS = obs
|
d.StreamControllers.OBS = obs
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) initTwitchBackend(ctx context.Context) error {
|
func (d *StreamD) initTwitchBackend(ctx context.Context) error {
|
||||||
twitch, err := newTwitch(
|
twitch, err := newTwitch(
|
||||||
ctx,
|
ctx,
|
||||||
p.StreamD.(*streamd.StreamD).Config.Backends[twitch.ID],
|
d.Config.Backends[twitch.ID],
|
||||||
p.inputTwitchUserInfo,
|
d.UI.InputTwitchUserInfo,
|
||||||
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
||||||
return p.savePlatformConfig(ctx, twitch.ID, cfg)
|
return d.setPlatformConfig(ctx, twitch.ID, cfg)
|
||||||
},
|
},
|
||||||
p.oauthHandlerTwitch)
|
d.UI.OAuthHandlerTwitch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
p.StreamD.(*streamd.StreamD).StreamControllers.Twitch = twitch
|
d.StreamControllers.Twitch = twitch
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) initYouTubeBackend(ctx context.Context) error {
|
func (d *StreamD) initYouTubeBackend(ctx context.Context) error {
|
||||||
youTube, err := newYouTube(
|
youTube, err := newYouTube(
|
||||||
ctx,
|
ctx,
|
||||||
p.StreamD.(*streamd.StreamD).Config.Backends[youtube.ID],
|
d.Config.Backends[youtube.ID],
|
||||||
p.inputYouTubeUserInfo,
|
d.UI.InputYouTubeUserInfo,
|
||||||
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
func(cfg *streamcontrol.AbstractPlatformConfig) error {
|
||||||
return p.savePlatformConfig(ctx, youtube.ID, cfg)
|
return d.setPlatformConfig(ctx, youtube.ID, cfg)
|
||||||
},
|
},
|
||||||
p.oauthHandlerYouTube,
|
d.UI.OAuthHandlerYouTube,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
p.StreamD.(*streamd.StreamD).StreamControllers.YouTube = youTube
|
d.StreamControllers.YouTube = youTube
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
@@ -70,6 +70,28 @@ func New(configPath string, ui ui.UI, b *belt.Belt) (*StreamD, error) {
|
|||||||
return d, nil
|
return d, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *StreamD) Run(ctx context.Context) error {
|
||||||
|
d.UI.SetStatus("Initializing remote GIT storage...")
|
||||||
|
err := d.FetchConfig(ctx)
|
||||||
|
if err != nil {
|
||||||
|
d.UI.DisplayError(fmt.Errorf("unable to initialize the GIT storage: %w", err))
|
||||||
|
}
|
||||||
|
|
||||||
|
d.UI.SetStatus("Initializing streaming backends...")
|
||||||
|
if err := d.EXPERIMENTAL_ReinitStreamControllers(ctx); err != nil {
|
||||||
|
return fmt.Errorf("unable to initialize stream controllers: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
d.UI.SetStatus("Pre-downloading user data from streaming backends...")
|
||||||
|
|
||||||
|
if err := d.InitCache(ctx); err != nil {
|
||||||
|
d.UI.DisplayError(fmt.Errorf("unable to initialize cache: %w", err))
|
||||||
|
}
|
||||||
|
|
||||||
|
d.UI.SetStatus("Initializing UI...")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (d *StreamD) readCache(ctx context.Context) error {
|
func (d *StreamD) readCache(ctx context.Context) error {
|
||||||
logger.Tracef(ctx, "readCache")
|
logger.Tracef(ctx, "readCache")
|
||||||
defer logger.Tracef(ctx, "/readCache")
|
defer logger.Tracef(ctx, "/readCache")
|
||||||
@@ -170,13 +192,13 @@ func (d *StreamD) InitCache(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *StreamD) SetPlatformConfig(
|
func (d *StreamD) setPlatformConfig(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
platID streamcontrol.PlatformName,
|
platID streamcontrol.PlatformName,
|
||||||
platCfg *streamcontrol.AbstractPlatformConfig,
|
platCfg *streamcontrol.AbstractPlatformConfig,
|
||||||
) error {
|
) error {
|
||||||
logger.Debugf(ctx, "SetPlatformConfig('%s', '%#+v')", platID, platCfg)
|
logger.Debugf(ctx, "setPlatformConfig('%s', '%#+v')", platID, platCfg)
|
||||||
defer logger.Debugf(ctx, "endof SetPlatformConfig('%s', '%#+v')", platID, platCfg)
|
defer logger.Debugf(ctx, "endof setPlatformConfig('%s', '%#+v')", platID, platCfg)
|
||||||
d.ConfigLock.Lock()
|
d.ConfigLock.Lock()
|
||||||
defer d.ConfigLock.Unlock()
|
defer d.ConfigLock.Unlock()
|
||||||
d.Config.Backends[platID] = platCfg
|
d.Config.Backends[platID] = platCfg
|
||||||
@@ -329,7 +351,7 @@ func (d *StreamD) IsBackendEnabled(ctx context.Context, id streamcontrol.Platfor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *StreamD) IsGITInitialized(ctx context.Context) (bool, error) {
|
func (d *StreamD) OBSOLETE_IsGITInitialized(ctx context.Context) (bool, error) {
|
||||||
return d.GitStorage != nil, nil
|
return d.GitStorage != nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,7 +411,10 @@ func (d *StreamD) EndStream(ctx context.Context, platID streamcontrol.PlatformNa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *StreamD) GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error) {
|
func (d *StreamD) GetBackendData(
|
||||||
|
ctx context.Context,
|
||||||
|
platID streamcontrol.PlatformName,
|
||||||
|
) (any, error) {
|
||||||
switch platID {
|
switch platID {
|
||||||
case obs.ID:
|
case obs.ID:
|
||||||
return api.BackendDataOBS{}, nil
|
return api.BackendDataOBS{}, nil
|
||||||
|
5
pkg/streamd/types/errors.go
Normal file
5
pkg/streamd/types/errors.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package streamd
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
var ErrSkipBackend = errors.New("backend was skipped")
|
@@ -1,11 +1,34 @@
|
|||||||
package ui
|
package ui
|
||||||
|
|
||||||
import "context"
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/oauthhandler"
|
||||||
|
"github.com/xaionaro-go/streamctl/pkg/streamcontrol"
|
||||||
|
obs "github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs/types"
|
||||||
|
twitch "github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch/types"
|
||||||
|
youtube "github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube/types"
|
||||||
|
)
|
||||||
|
|
||||||
type UI interface {
|
type UI interface {
|
||||||
|
SetStatus(string)
|
||||||
DisplayError(error)
|
DisplayError(error)
|
||||||
Restart(context.Context, string)
|
Restart(context.Context, string)
|
||||||
InputGitUserData(
|
InputGitUserData(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
) (bool, string, []byte, error)
|
) (bool, string, []byte, error)
|
||||||
|
OAuthHandlerTwitch(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error
|
||||||
|
OAuthHandlerYouTube(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error
|
||||||
|
InputTwitchUserInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[twitch.PlatformSpecificConfig, twitch.StreamProfile],
|
||||||
|
) (bool, error)
|
||||||
|
InputYouTubeUserInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[youtube.PlatformSpecificConfig, youtube.StreamProfile],
|
||||||
|
) (bool, error)
|
||||||
|
InputOBSConnectInfo(
|
||||||
|
ctx context.Context,
|
||||||
|
cfg *streamcontrol.PlatformConfig[obs.PlatformSpecificConfig, obs.StreamProfile],
|
||||||
|
) (bool, error)
|
||||||
}
|
}
|
||||||
|
@@ -68,6 +68,8 @@ type Panel struct {
|
|||||||
|
|
||||||
configPath string
|
configPath string
|
||||||
configCache *config.Config
|
configCache *config.Config
|
||||||
|
|
||||||
|
setStatusFunc func(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(
|
func New(
|
||||||
@@ -80,6 +82,13 @@ func New(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Panel) SetStatus(msg string) {
|
||||||
|
if p.setStatusFunc == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
p.setStatusFunc(msg)
|
||||||
|
}
|
||||||
|
|
||||||
func (p *Panel) Loop(ctx context.Context) error {
|
func (p *Panel) Loop(ctx context.Context) error {
|
||||||
if p.defaultContext != nil {
|
if p.defaultContext != nil {
|
||||||
return fmt.Errorf("Loop was already used, and cannot be used the second time")
|
return fmt.Errorf("Loop was already used, and cannot be used the second time")
|
||||||
@@ -98,27 +107,18 @@ func (p *Panel) Loop(ctx context.Context) error {
|
|||||||
loadingWindow := p.newLoadingWindow(ctx)
|
loadingWindow := p.newLoadingWindow(ctx)
|
||||||
resizeWindow(loadingWindow, fyne.NewSize(600, 600))
|
resizeWindow(loadingWindow, fyne.NewSize(600, 600))
|
||||||
|
|
||||||
loadingWindowText := widget.NewRichTextFromMarkdown("# Initializing remote GIT storage...")
|
loadingWindowText := widget.NewRichTextFromMarkdown("")
|
||||||
loadingWindowText.Wrapping = fyne.TextWrapWord
|
loadingWindowText.Wrapping = fyne.TextWrapWord
|
||||||
loadingWindow.SetContent(loadingWindowText)
|
loadingWindow.SetContent(loadingWindowText)
|
||||||
if os.Getenv("STREAMPANEL_QUICKSTART") != "" {
|
p.setStatusFunc = func(msg string) {
|
||||||
go p.StreamD.FetchConfig(ctx)
|
loadingWindowText.ParseMarkdown(fmt.Sprintf("# %s", msg))
|
||||||
} else {
|
|
||||||
p.StreamD.FetchConfig(ctx)
|
|
||||||
}
|
}
|
||||||
|
err := p.StreamD.Run(ctx)
|
||||||
loadingWindowText.ParseMarkdown("# Initializing streaming backends...")
|
if err != nil {
|
||||||
if err := p.initStreamControllers(ctx); err != nil {
|
p.DisplayError(fmt.Errorf("unable to initialize the streaming controllers: %w", err))
|
||||||
err = fmt.Errorf("unable to initialize stream controllers: %w", err)
|
os.Exit(1)
|
||||||
p.DisplayError(err)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
p.setStatusFunc = nil
|
||||||
loadingWindowText.ParseMarkdown("# Pre-downloading user data from streaming backends...")
|
|
||||||
|
|
||||||
p.StreamD.InitCache(ctx)
|
|
||||||
|
|
||||||
loadingWindowText.ParseMarkdown("# Initializing UI...")
|
|
||||||
|
|
||||||
p.initMainWindow(ctx)
|
p.initMainWindow(ctx)
|
||||||
if err := p.rearrangeProfiles(ctx); err != nil {
|
if err := p.rearrangeProfiles(ctx); err != nil {
|
||||||
@@ -160,16 +160,6 @@ func (p *Panel) initStreamD(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) savePlatformConfig(
|
|
||||||
ctx context.Context,
|
|
||||||
platID streamcontrol.PlatformName,
|
|
||||||
platCfg *streamcontrol.AbstractPlatformConfig,
|
|
||||||
) error {
|
|
||||||
logger.Debugf(ctx, "savePlatformConfig('%s', '%#+v')", platID, platCfg)
|
|
||||||
defer logger.Debugf(ctx, "endof savePlatformConfig('%s', '%#+v')", platID, platCfg)
|
|
||||||
return p.StreamD.SetPlatformConfig(ctx, platID, platCfg)
|
|
||||||
}
|
|
||||||
|
|
||||||
func removeNonDigits(input string) string {
|
func removeNonDigits(input string) string {
|
||||||
var result []rune
|
var result []rune
|
||||||
for _, r := range input {
|
for _, r := range input {
|
||||||
@@ -180,7 +170,7 @@ func removeNonDigits(input string) string {
|
|||||||
return string(result)
|
return string(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) inputOBSConnectInfo(
|
func (p *Panel) InputOBSConnectInfo(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
cfg *streamcontrol.PlatformConfig[obs.PlatformSpecificConfig, obs.StreamProfile],
|
cfg *streamcontrol.PlatformConfig[obs.PlatformSpecificConfig, obs.StreamProfile],
|
||||||
) (bool, error) {
|
) (bool, error) {
|
||||||
@@ -258,15 +248,15 @@ func (p *Panel) inputOBSConnectInfo(
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) oauthHandlerTwitch(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error {
|
func (p *Panel) OAuthHandlerTwitch(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error {
|
||||||
logger.Infof(ctx, "oauthHandlerTwitch: %#+v", arg)
|
logger.Infof(ctx, "OAuthHandlerTwitch: %#+v", arg)
|
||||||
defer logger.Infof(ctx, "/oauthHandlerTwitch")
|
defer logger.Infof(ctx, "/OAuthHandlerTwitch")
|
||||||
return p.oauthHandler(ctx, arg)
|
return p.oauthHandler(ctx, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) oauthHandlerYouTube(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error {
|
func (p *Panel) OAuthHandlerYouTube(ctx context.Context, arg oauthhandler.OAuthHandlerArgument) error {
|
||||||
logger.Infof(ctx, "oauthHandlerYouTube: %#+v", arg)
|
logger.Infof(ctx, "OAuthHandlerYouTube: %#+v", arg)
|
||||||
defer logger.Infof(ctx, "/oauthHandlerYouTube")
|
defer logger.Infof(ctx, "/OAuthHandlerYouTube")
|
||||||
return p.oauthHandler(ctx, arg)
|
return p.oauthHandler(ctx, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +330,7 @@ func (p *Panel) openBrowser(authURL string) error {
|
|||||||
|
|
||||||
var twitchAppsCreateLink, _ = url.Parse("https://dev.twitch.tv/console/apps/create")
|
var twitchAppsCreateLink, _ = url.Parse("https://dev.twitch.tv/console/apps/create")
|
||||||
|
|
||||||
func (p *Panel) inputTwitchUserInfo(
|
func (p *Panel) InputTwitchUserInfo(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
cfg *streamcontrol.PlatformConfig[twitch.PlatformSpecificConfig, twitch.StreamProfile],
|
cfg *streamcontrol.PlatformConfig[twitch.PlatformSpecificConfig, twitch.StreamProfile],
|
||||||
) (bool, error) {
|
) (bool, error) {
|
||||||
@@ -401,7 +391,7 @@ func (p *Panel) inputTwitchUserInfo(
|
|||||||
|
|
||||||
var youtubeCredentialsCreateLink, _ = url.Parse("https://console.cloud.google.com/apis/credentials/oauthclient")
|
var youtubeCredentialsCreateLink, _ = url.Parse("https://console.cloud.google.com/apis/credentials/oauthclient")
|
||||||
|
|
||||||
func (p *Panel) inputYouTubeUserInfo(
|
func (p *Panel) InputYouTubeUserInfo(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
cfg *streamcontrol.PlatformConfig[youtube.PlatformSpecificConfig, youtube.StreamProfile],
|
cfg *streamcontrol.PlatformConfig[youtube.PlatformSpecificConfig, youtube.StreamProfile],
|
||||||
) (bool, error) {
|
) (bool, error) {
|
||||||
@@ -456,36 +446,6 @@ func (p *Panel) inputYouTubeUserInfo(
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Panel) initStreamControllers(ctx context.Context) error {
|
|
||||||
cfg, err := p.StreamD.GetConfig(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to get config: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
platNames := make([]streamcontrol.PlatformName, 0, len(cfg.Backends))
|
|
||||||
for platName := range cfg.Backends {
|
|
||||||
platNames = append(platNames, platName)
|
|
||||||
}
|
|
||||||
sort.Slice(platNames, func(i, j int) bool {
|
|
||||||
return platNames[i] < platNames[j]
|
|
||||||
})
|
|
||||||
for _, platName := range platNames {
|
|
||||||
var err error
|
|
||||||
switch strings.ToLower(string(platName)) {
|
|
||||||
case strings.ToLower(string(obs.ID)):
|
|
||||||
err = p.initOBSBackend(ctx)
|
|
||||||
case strings.ToLower(string(twitch.ID)):
|
|
||||||
err = p.initTwitchBackend(ctx)
|
|
||||||
case strings.ToLower(string(youtube.ID)):
|
|
||||||
err = p.initYouTubeBackend(ctx)
|
|
||||||
}
|
|
||||||
if err != nil && err != ErrSkipBackend {
|
|
||||||
return fmt.Errorf("unable to initialize '%s': %w", platName, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *Panel) profileCreateOrUpdate(ctx context.Context, profile Profile) error {
|
func (p *Panel) profileCreateOrUpdate(ctx context.Context, profile Profile) error {
|
||||||
cfg, err := p.StreamD.GetConfig(ctx)
|
cfg, err := p.StreamD.GetConfig(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -756,7 +716,7 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
backendEnabled[backendID] = isEnabled
|
backendEnabled[backendID] = isEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
gitIsEnabled, err := p.StreamD.IsGITInitialized(ctx)
|
gitIsEnabled, err := p.StreamD.OBSOLETE_IsGITInitialized(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to get info if GIT is initialized: %w", err)
|
return fmt.Errorf("unable to get info if GIT is initialized: %w", err)
|
||||||
}
|
}
|
||||||
@@ -824,15 +784,17 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
if cfg.Backends[obs.ID] == nil {
|
if cfg.Backends[obs.ID] == nil {
|
||||||
obs.InitConfig(cfg.Backends)
|
obs.InitConfig(cfg.Backends)
|
||||||
}
|
}
|
||||||
oldEnable := cfg.Backends[obs.ID].Enable
|
|
||||||
oldCfg := cfg.Backends[obs.ID].Config
|
|
||||||
cfg.Backends[obs.ID].Enable = nil
|
cfg.Backends[obs.ID].Enable = nil
|
||||||
cfg.Backends[obs.ID].Config = obs.PlatformSpecificConfig{}
|
cfg.Backends[obs.ID].Config = obs.PlatformSpecificConfig{}
|
||||||
err := p.initOBSBackend(ctx)
|
|
||||||
if err != nil {
|
if err := p.StreamD.SetConfig(ctx, cfg); err != nil {
|
||||||
|
p.DisplayError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := p.StreamD.EXPERIMENTAL_ReinitStreamControllers(ctx); err != nil {
|
||||||
p.DisplayError(err)
|
p.DisplayError(err)
|
||||||
cfg.Backends[obs.ID].Enable = oldEnable
|
|
||||||
cfg.Backends[obs.ID].Config = oldCfg
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -843,15 +805,17 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
if cfg.Backends[twitch.ID] == nil {
|
if cfg.Backends[twitch.ID] == nil {
|
||||||
twitch.InitConfig(cfg.Backends)
|
twitch.InitConfig(cfg.Backends)
|
||||||
}
|
}
|
||||||
oldEnable := cfg.Backends[twitch.ID].Enable
|
|
||||||
oldCfg := cfg.Backends[twitch.ID].Config
|
|
||||||
cfg.Backends[twitch.ID].Enable = nil
|
cfg.Backends[twitch.ID].Enable = nil
|
||||||
cfg.Backends[twitch.ID].Config = twitch.PlatformSpecificConfig{}
|
cfg.Backends[twitch.ID].Config = twitch.PlatformSpecificConfig{}
|
||||||
err := p.initTwitchBackend(ctx)
|
|
||||||
if err != nil {
|
if err := p.StreamD.SetConfig(ctx, cfg); err != nil {
|
||||||
|
p.DisplayError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := p.StreamD.EXPERIMENTAL_ReinitStreamControllers(ctx); err != nil {
|
||||||
p.DisplayError(err)
|
p.DisplayError(err)
|
||||||
cfg.Backends[twitch.ID].Enable = oldEnable
|
|
||||||
cfg.Backends[twitch.ID].Config = oldCfg
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -862,14 +826,16 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
if cfg.Backends[youtube.ID] == nil {
|
if cfg.Backends[youtube.ID] == nil {
|
||||||
youtube.InitConfig(cfg.Backends)
|
youtube.InitConfig(cfg.Backends)
|
||||||
}
|
}
|
||||||
oldEnable := cfg.Backends[youtube.ID].Enable
|
|
||||||
oldCfg := cfg.Backends[youtube.ID].Config
|
cfg.Backends[youtube.ID].Enable = nil
|
||||||
cfg.Backends[youtube.ID].Config = youtube.PlatformSpecificConfig{}
|
cfg.Backends[youtube.ID].Config = youtube.PlatformSpecificConfig{}
|
||||||
err := p.initYouTubeBackend(ctx)
|
if err := p.StreamD.SetConfig(ctx, cfg); err != nil {
|
||||||
if err != nil {
|
p.DisplayError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := p.StreamD.EXPERIMENTAL_ReinitStreamControllers(ctx); err != nil {
|
||||||
p.DisplayError(err)
|
p.DisplayError(err)
|
||||||
cfg.Backends[youtube.ID].Enable = oldEnable
|
|
||||||
cfg.Backends[youtube.ID].Config = oldCfg
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -890,7 +856,7 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
widget.NewRichTextFromMarkdown(`# Syncing (via git)`),
|
widget.NewRichTextFromMarkdown(`# Syncing (via git)`),
|
||||||
container.NewHBox(
|
container.NewHBox(
|
||||||
widget.NewButtonWithIcon("(Re-)login in GIT", theme.LoginIcon(), func() {
|
widget.NewButtonWithIcon("(Re-)login in GIT", theme.LoginIcon(), func() {
|
||||||
err := p.StreamD.GitRelogin(ctx)
|
err := p.StreamD.OBSOLETE_GitRelogin(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.DisplayError(err)
|
p.DisplayError(err)
|
||||||
}
|
}
|
||||||
@@ -908,10 +874,6 @@ func (p *Panel) openSettingsWindow(ctx context.Context) error {
|
|||||||
|
|
||||||
w.Show()
|
w.Show()
|
||||||
|
|
||||||
if err := p.StreamD.SetConfig(ctx, cfg); err != nil {
|
|
||||||
return fmt.Errorf("unable to set the config: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user