model

package
v3.3.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: MIT Imports: 6 Imported by: 0

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