@@ -12,7 +12,7 @@ import (
1212)
1313
1414const (
15- StreamPolicyAnyone = "ANYONE"
15+ streamPolicyAnyone = "ANYONE"
1616 StreamPolicyWithReserved = "ANYONE_WITH_RESERVED"
1717 StreamPolicyReservedOnly = "RESERVED"
1818)
@@ -41,7 +41,7 @@ func CreateProfile(streamKey string) (string, error) {
4141
4242 fileName := streamKey + "_" + token
4343 profileFilePath := filepath .Join (profilePath , fileName )
44- profile := Profile {
44+ profile := profile {
4545 FileName : fileName ,
4646 IsPublic : true ,
4747 MOTD : "Welcome to " + streamKey + "!" ,
@@ -67,7 +67,7 @@ func CreateProfile(streamKey string) (string, error) {
6767// Update a current profile
6868func UpdateProfile (token string , motd string , isPublic bool ) error {
6969 if ! hasExistingBearerToken (token ) {
70- return fmt .Errorf ("Profile was not found" )
70+ return fmt .Errorf ("profile was not found" )
7171 }
7272
7373 profile , err := GetPersonalProfile (token )
@@ -116,7 +116,7 @@ func RemoveProfile(streamKey string) (bool, error) {
116116 fileName , _ := getProfileFileNameByStreamKey (streamKey )
117117 if fileName == "" {
118118 log .Println ("Authorization: RemoveProfile could not find" , streamKey )
119- return false , fmt .Errorf ("Profile could not be found" )
119+ return false , fmt .Errorf ("profile could not be found" )
120120 }
121121
122122 profilePath := os .Getenv (environment .StreamProfilePath )
@@ -143,14 +143,14 @@ func GetPublicProfile(bearerToken string) (*PublicProfile, error) {
143143 return nil , err
144144 }
145145
146- var profile Profile
146+ var profile profile
147147 if err := json .Unmarshal (data , & profile ); err != nil {
148148 log .Println ("Authorization: File" , bearerToken , "could not read. File may be corrupt." )
149149 return nil , err
150150 }
151151 profile .FileName = fileName
152152
153- return profile .AsPublicProfile (), nil
153+ return profile .asPublicProfile (), nil
154154}
155155
156156// Returns the publicly available profile
@@ -168,18 +168,18 @@ func GetPersonalProfile(bearerToken string) (*PersonalProfile, error) {
168168 return nil , err
169169 }
170170
171- var profile Profile
171+ var profile profile
172172 if err := json .Unmarshal (data , & profile ); err != nil {
173173 log .Println ("Authorization: File" , bearerToken , "could not read. File may be corrupt." )
174174 return nil , err
175175 }
176176 profile .FileName = fileName
177177
178- return profile .AsPersonalProfile (), nil
178+ return profile .asPersonalProfile (), nil
179179}
180180
181181// Returns a slice of profiles intended for admin endpoints
182- func GetAdminProfilesAll () (profiles []AdminProfile , err error ) {
182+ func GetAdminProfilesAll () (profiles []adminProfile , err error ) {
183183 profilePath := os .Getenv (environment .StreamProfilePath )
184184
185185 files , err := os .ReadDir (profilePath )
@@ -191,7 +191,7 @@ func GetAdminProfilesAll() (profiles []AdminProfile, err error) {
191191 for _ , file := range files {
192192 data , err := os .ReadFile (filepath .Join (profilePath , file .Name ()))
193193 if err != nil {
194- profiles = append (profiles , AdminProfile {
194+ profiles = append (profiles , adminProfile {
195195 StreamKey : file .Name (),
196196 IsPublic : false ,
197197 MOTD : "Error reading profile from file: " + file .Name (),
@@ -200,10 +200,10 @@ func GetAdminProfilesAll() (profiles []AdminProfile, err error) {
200200 continue
201201 }
202202
203- var profile Profile
203+ var profile profile
204204
205205 if err := json .Unmarshal (data , & profile ); err != nil {
206- profiles = append (profiles , AdminProfile {
206+ profiles = append (profiles , adminProfile {
207207 StreamKey : file .Name (),
208208 IsPublic : false ,
209209 MOTD : "Invalid JSON in file" + file .Name (),
@@ -212,7 +212,7 @@ func GetAdminProfilesAll() (profiles []AdminProfile, err error) {
212212 }
213213
214214 profile .FileName = file .Name ()
215- profiles = append (profiles , * profile .AsAdminProfile ())
215+ profiles = append (profiles , * profile .asAdminProfile ())
216216 }
217217
218218 return profiles , nil
0 commit comments