hackmud

package
v0.0.0-...-c3df548 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceToJSON

func InterfaceToJSON(v interface{}) (string, error)

InterfaceToJSON converts any interface or struct to a prettyfied JSON string

Types

type AccountData

type AccountData struct {
	Users User `json:"users"`
	// contains filtered or unexported fields
}

AccountData for the account

func (*AccountData) String

func (a *AccountData) String() string

TODO: Can we somehow do this globally for everything? Override default stringer for AcccountData

func (*AccountData) ToJSON

func (a *AccountData) ToJSON() string

ToJSON attempts to return a prettyfied JSON string

type Channel

type Channel map[ChannelName][]UserName

Channel for the AccountData

type ChannelName

type ChannelName string

ChannelName is just a string wrapper

type Client

type Client struct {
	HTTPClient *http.Client
	Debug      bool
	// contains filtered or unexported fields
}

Client for API operations

func NewClient

func NewClient(apiToken string) *Client

NewClient creates new Hackmud Chat API client with given API key

func (*Client) GetAccountData

func (c *Client) GetAccountData() (*AccountData, error)

GetAccountData returns the account data for the current account

type User

type User map[UserName]Channel

User for the AccountData

type UserName

type UserName string

UserName is just a string wrapper

Jump to

Keyboard shortcuts

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