forked from Cliffbreak/tsviewer
clean up
This commit is contained in:
parent
edbf70eede
commit
119f9c4915
3 changed files with 1 additions and 55 deletions
|
@ -1,7 +1,6 @@
|
|||
# tsviewer **[WIP]**
|
||||
## **WARNING** This API is not usable ATM
|
||||
|
||||
A REST API made for TS3 Viewer.
|
||||
A TS3 Viewer with REST API.
|
||||
|
||||
# Features
|
||||
## Config
|
||||
|
|
|
@ -26,10 +26,6 @@ func (s Service) Client(id int) (*client.Client, error) {
|
|||
return nil, errors.New("client does not exist")
|
||||
}
|
||||
|
||||
/* if _, err := s.TSClient.Server.ExecCmd(ts3.NewCmd(fmt.Sprintf("clientinfo clid=%d", c.ID)).WithResponse(&c)); err != nil {
|
||||
return nil, err
|
||||
} */
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
package stringer
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
func Build(ss ...string) (string, error) {
|
||||
var builder strings.Builder
|
||||
|
||||
for _, s := range ss {
|
||||
if _, err := builder.WriteString(s); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
return builder.String(), nil
|
||||
}
|
||||
|
||||
func ToCamel(str string) string {
|
||||
if len(str) < 1 {
|
||||
return str
|
||||
}
|
||||
|
||||
for i, c := range str[1:] {
|
||||
if c >= 'A' && c <= 'Z' {
|
||||
str = fmt.Sprintf("%s_%c%s", str[:i+1], unicode.ToLower(c), str[i+2:])
|
||||
return ToCamel(str)
|
||||
}
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func ToSnake(str string) string {
|
||||
if len(str) < 1 {
|
||||
return str
|
||||
}
|
||||
|
||||
for i, c := range str[1:] {
|
||||
if c == '_' {
|
||||
str = fmt.Sprintf("%s%c%s", str[:i+1], unicode.ToUpper(rune(str[i+2])), str[i+3:])
|
||||
return ToSnake(str)
|
||||
}
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
Loading…
Reference in a new issue