README
¶
ArtifactDeckCode port for go.
Uses an Artifact deck code to create a Deck struct with Heroes and Cards. Can also be used to encode a Deck struct into the URL-safe base64 string.
Installing
go get github.com/pvaass/artifactdeck
Usage
import artifact "github.com/pvaass/artifactdeck"
func main() {
var deckCode string
var deck artifact.Deck
// Create Deck from string
err = deck.UnmarshalText(deckCode)
if err != nil {
panic(err)
}
// Create string from Deck
text, err = deck.MarshalText()
if err != nil {
panic(err)
}
}
Docs
Documentation
¶
Index ¶
Constants ¶
View Source
const Prefix = "ADC"
Prefix The prefix for the result string
View Source
const Version = 2
Version Current ADC version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deck ¶
Deck The unencoded deck
func (*Deck) MarshalText ¶
MarshalText Encodes a Deck struct to a base64 encoded byte array
func (*Deck) UnmarshalText ¶
UnmarshalText Decodes a base64 encoded byte array to a Deck struct
Click to show internal directories.
Click to hide internal directories.