Skip to content

Commit

Permalink
Marshalling properly (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mja00 authored Mar 1, 2021
1 parent 8bceab7 commit feee348
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,32 @@ type obsServicesFile struct {
}

type obsService struct {
Name string `json:"name"`
Servers []struct {
Name string `json:"name"`
AltNames []string `json:"alt_names,omitempty"`
Common bool `json:"common,omitempty"`
Servers []struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"servers"`
Recommended struct {
Keyint int `json:"keyint"`
Output string `json:"output"`
MaxAudioBitrate int `json:"max audio bitrate"`
MaxVideoBitrate int `json:"max video bitrate"`
Bframes int `json:"bframes"`
X264Opts string `json:"x264opts"`
} `json:"recommended"`
Recommended *struct {
Keyint *int `json:"keyint,omitempty"`
Profile string `json:"profile,omitempty"`
Output string `json:"output,omitempty"`
MaxVideoBitrate int `json:"max video bitrate,omitempty"`
MaxAudioBitrate int `json:"max audio bitrate,omitempty"`
Bframes *int `json:"bframes,omitempty"`
X264Opts string `json:"x264opts,omitempty"`
} `json:"recommended,omitempty"`
// For some reason a few services use 'recommend' instead of 'recommended'
Recommend *struct {
Keyint *int `json:"keyint,omitempty"`
Profile string `json:"profile,omitempty"`
Output string `json:"output,omitempty"`
MaxVideoBitrate int `json:"max video bitrate,omitempty"`
MaxAudioBitrate int `json:"max audio bitrate,omitempty"`
Bframes *int `json:"bframes,omitempty"`
X264Opts string `json:"x264opts,omitempty"`
} `json:"recommend,omitempty"`
}

type logWriter struct {
Expand Down

0 comments on commit feee348

Please sign in to comment.