You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-mcm/mcm.go

35 lines
596 B

package mcm
import (
"fmt"
"strings"
"git.jojodev.com/Minecraft/go-mcm/model"
"git.jojodev.com/Minecraft/go-mcm/web"
)
type MCM struct {
Token string
URL string
}
func NewMCM(token, baseURL string) *MCM {
return &MCM{
Token: token,
URL: strings.TrimRight(baseURL, "/"),
}
}
func (mcm *MCM) NewModel() *model.Model {
return &model.Model{
Token: mcm.Token,
URL: fmt.Sprintf("%s/model", strings.TrimRight(mcm.URL, "/")),
}
}
func (mcm *MCM) NewWeb() *web.Web {
return &web.Web{
Token: mcm.Token,
URL: fmt.Sprintf("%s/web", strings.TrimRight(mcm.URL, "/")),
}
}