23 lines
337 B
Go
23 lines
337 B
Go
|
package web
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
type Web struct {
|
||
|
Token string
|
||
|
URL string
|
||
|
}
|
||
|
|
||
|
func NewWeb(token, baseURL string) *Web {
|
||
|
return &Web{
|
||
|
Token: token,
|
||
|
URL: fmt.Sprintf("%s/web", strings.TrimRight(baseURL, "/")),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (web *Web) endpoint(endpoint string) string {
|
||
|
return fmt.Sprintf("%s/%s/", web.URL, endpoint)
|
||
|
}
|