docs: add godoc comments to all exported functions and methods

This commit is contained in:
adman
2026-07-30 00:20:55 +02:00
parent 56c97a2b3f
commit 0d6b6e1ab9
50 changed files with 186 additions and 408 deletions
+5
View File
@@ -289,6 +289,9 @@ func (a *Account) CheckGiftCodeValidity(giftCode string) (valid bool, err error)
return
}
// NewAccountFromYGG creates an Account by authenticating the YGG token against
// Mojang's API. It makes an HTTP call to fetch the player profile and returns
// an Account with name and UUID populated, or an error if authentication fails.
func NewAccountFromYGG(ygg string) (a *Account, err error) {
a = &Account{
Ygg: ygg,
@@ -303,6 +306,8 @@ func NewAccountFromYGG(ygg string) (a *Account, err error) {
return
}
// NewAccount creates an Account from explicit name, UUID, and YGG token without
// making any HTTP calls. The account uses Mojang's default API servers.
func NewAccount(name string, uuid uuid.UUID, ygg string) (a *Account) {
return &Account{
Name: name,