go-mcm/web/web.go

23 lines
337 B
Go
Raw Normal View History

2019-10-03 20:22:22 +00:00
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)
}