model

package
v3.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 6 Imported by: 25

Documentation

Index

Constants

View Source
const (
	TimestampFormat = time.RFC3339
	Indent          = "  "
)

Variables

This section is empty.

Functions

func Age

func Age(timestamp time.Time) string

func RenderTable

func RenderTable(renderer TableItem) string

Types

type Config

type Config struct {
	StorableConfig
	Tokens
	APIaddr     string
	Fingerprint string
	Log         io.Writer
}

type JSONrenderer

type JSONrenderer interface {
	RenderJSON() (string, error)
}

type Renderer

type Renderer interface {
	TableRenderer
	YAMLrenderer
	JSONrenderer
}

type StorableConfig

type StorableConfig struct {
	UserInfo
}

type TableItem

type TableItem interface {
	TableHeaders() []string
	TableRows() [][]string
}

type TableRenderer

type TableRenderer interface {
	RenderTable() string
}

type Tokens

type Tokens struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Tokens -- access and refresh client tokens

type UserInfo

type UserInfo struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type YAMLrenderer

type YAMLrenderer interface {
	RenderYAML() (string, error)
}

Jump to

Keyboard shortcuts

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