mojang

package
v0.0.0-...-527bd1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROFILES_PER_REQUEST = 100
	MOJANG_SERVER        = "https://api.mojang.com"
	PROFILE_URL_FMT      = "%s/profiles/minecraft"
	LOG_TAG              = "[HttpProfileRepository]"
)

Variables

View Source
var (
	ERR_NO_SUCH_USER     = errors.New(`no such user`)
	ERR_TOO_MANY_RESULTS = errors.New(`too many results`)
)

Functions

This section is empty.

Types

type HttpProfileRepository

type HttpProfileRepository struct {
	// contains filtered or unexported fields
}

func NewHttpProfileRepository

func NewHttpProfileRepository(c *http.Client) HttpProfileRepository

func (HttpProfileRepository) GetProfilesByUsername

func (hpr HttpProfileRepository) GetProfilesByUsername(usernames []string) (profiles []Profile, err error)

type Profile

type Profile struct {
	Id   string
	Name string
}

func GetProfileByUsername

func GetProfileByUsername(c *http.Client, username string) (Profile, error)

type ProfileCriteria

type ProfileCriteria []string
type ProfileCriteria struct {
	Name  string `json:"name"`
	Agent string `json:"agent"`
}

type ProfileRepository

type ProfileRepository interface {
	GetProfilesByCriteria([]ProfileCriteria) []Profile
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL