microbadge

package
v0.0.0-...-129c87e Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package microbadge contains functions to retrieve and set microbadges.

Index

Constants

View Source
const TotalSlots = 5

Variables

This section is empty.

Functions

func ClearSlot

func ClearSlot(slot uint) (err error)

ClearSlot clears the specified slot.

func SetAll

func SetAll(badgeNumbers []uint) (success bool, err error)

SetAll takes a collection of microbadge IDs and sends them to the server to set as the displayed microbadges.

func SetSlot

func SetSlot(slot, badgeNumber uint) (success bool, err error)

SetSlot updates the specified microbadge display slot with the microbadge specified by the ID passed in.

func ValidSlot

func ValidSlot(n uint) (result bool)

ValidSlot checks whether the specified number is a valid slot number, i.e. an integer between and 1 and the number of slots.

Types

type Group

type Group struct {
	GroupNumber uint
	Name        string
}

type Microbadge

type Microbadge struct {
	BadgeNumber    uint
	Name           string
	Category       Group
	Subcategory    Group
	Subsubcategory Group
	NumberOfOwners uint
	Mouseover      string
	Creator        string
	Description    string
	ImageFilename  string
}

func GetAll

func GetAll() (badges []Microbadge, err error)

GetAll returns a collection of all the user's microbadges.

func GetSlot

func GetSlot(slot uint) (mb Microbadge, err error)

GetSlot returns the microbadge in the specified slot.

func (Microbadge) String

func (mb Microbadge) String() string

Directories

Path Synopsis
Package constraints implements a data structure to describe which microbadges can be shown with in which slots and other constraints.
Package constraints implements a data structure to describe which microbadges can be shown with in which slots and other constraints.

Jump to

Keyboard shortcuts

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