Go to file
Etzelia bfe77e9da6
Tabs vs Spaces
Signed-off-by: Etzelia <etzelia@hotmail.com>
2019-10-02 15:03:44 -05:00
model Initial Release (#1) 2019-10-02 21:03:23 +02:00
.gitignore Initial Release (#1) 2019-10-02 21:03:23 +02:00
README.md Tabs vs Spaces 2019-10-02 15:03:44 -05:00
go.mod Initial Release (#1) 2019-10-02 21:03:23 +02:00

README.md

go-mcm

Go library for MCM

Model Example

package main

import (
	"fmt"
	"go.etztech.xyz/go-mcm/model"
	"go.etztech.xyz/go-mcm/model/django"
)

func main() {
	query := model.NewQuery("<token>", "https://24carrotcraft.com/whitelist/api")
	builder := query.NewDjangoBuilder().Contains(django.PlayerUsername, "Etzelia")

	players, err := query.Player(builder)
	if err != nil {
		fmt.Println(err)
	}

	for _, player := range players {
		fmt.Printf("%#v\n", player)
	}
}

Response (formatted)

&model.Player{
    ID:            663,
    AuthUserID:    0,
    UUID:          "de10775b-fcb1-4665-bce4-5924b2e30188",
    Username:      "MrsEtzelia",
    ApplicationID: 1,
    FirstSeen:     "2016-12-18",
    LastSeen:      "2017-11-23",
    Link:          "https://www.24carrotcraft.com/whitelist/dashboard/player/663",
}

&model.Player{
    ID:            724,
    AuthUserID:    1,
    UUID:          "bf0446a8-9695-4c41-aa4c-7ff45bfd1171",
    Username:      "Etzelia",
    ApplicationID: 838,
    FirstSeen:     "2016-12-02",
    LastSeen:      "2019-10-02",
    Link:          "https://www.24carrotcraft.com/whitelist/dashboard/player/724",
}