Documentation ¶
Index ¶
- Variables
- func CLI(args []string) error
- type Client
- func (cl Client) GetPosts(tags []string) ([]Post, error)
- func (cl Client) GetTags() (map[string]int, error)
- func (cl Client) SearchPosts(out io.Writer, tags []string) error
- func (cl Client) SearchTags(out io.Writer, tags []string) error
- func (cl *Client) SetToken(token string)
- func (cl *Client) SetUsernamePassword(u, p string)
- func (cl Client) TagsLike(tags ...string) ([]TagCount, error)
- type Post
- type RawAllPostsResponse
- type TagCount
Constants ¶
This section is empty.
Variables ¶
View Source
var Template = template.Must( template.New(""). Funcs(template.FuncMap{ "bold": func(s string) string { if !isatty.IsTerminal(os.Stdout.Fd()) { return s } return ansi.Color(s, "red+b") }, "underline": func(s string) string { if !isatty.IsTerminal(os.Stdout.Fd()) { return s } return ansi.Color(s, "white+u") }, }). Parse( ` {{- range . -}} Title: {{ .Title | bold }}{{ with .Description }} Description: {{ . }}{{ end }} Date: {{ .Time.Local.Format "Jan. 2, 2006 3:04pm" }} Tags: {{range .Tags}}{{ . }} {{end}} URL: {{ .URL.String | underline }} {{ end -}}`, ), )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SetUsernamePassword ¶
type RawAllPostsResponse ¶
type RawAllPostsResponse []struct { Description string `json:"description"` Extended string `json:"extended"` Hash string `json:"hash"` Href string `json:"href"` Meta string `json:"meta"` Shared string `json:"shared"` Tags string `json:"tags"` Time time.Time `json:"time"` ToRead string `json:"toread"` }
func (RawAllPostsResponse) ToPosts ¶
func (raw RawAllPostsResponse) ToPosts() []Post
Click to show internal directories.
Click to hide internal directories.