cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK         = 0
	ExitCodeParseError = 1
	ExitCodeSomeError  = 2
)
View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

func OutputVersion

func OutputVersion() string

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

func NewCLI

func NewCLI(inStream io.Reader, outStream io.Writer, errStream io.Writer) *CLI

func (*CLI) Run

func (c *CLI) Run(args []string) int

type ConversationHistoryJSON

type ConversationHistoryJSON struct {
	Ok               bool   `json:"ok"`
	Error            string `json:"error"`
	ResponseMetadata struct {
		Messages []string `json:"messages"`
	} `json:"response_metadata"`
	Messages []Message `json:"messages"`
}

func (*ConversationHistoryJSON) ToSlackThreads

func (h *ConversationHistoryJSON) ToSlackThreads() SlackThreads

type ConversationRepliesJSON added in v0.2.0

type ConversationRepliesJSON struct {
	Ok               bool   `json:"ok"`
	Error            string `json:"error"`
	ResponseMetadata struct {
		Messages []string `json:"messages"`
	} `json:"response_metadata"`
	Messages []struct {
		Type  string `json:"type"`
		Ts    string `json:"ts"`
		Files []struct {
			ID                 string `json:"id"`
			Timestamp          int    `json:"timestamp"`
			Name               string `json:"name"`
			Title              string `json:"title"`
			Mimetype           string `json:"mimetype"`
			Filetype           string `json:"filetype"`
			PrettyType         string `json:"pretty_type"`
			User               string `json:"user"`
			Size               int    `json:"size"`
			IsPublic           bool   `json:"is_public"`
			PublicURLShared    bool   `json:"public_url_shared"`
			DisplayAsBot       bool   `json:"display_as_bot"`
			Username           string `json:"username"`
			URLPrivate         string `json:"url_private"`
			URLPrivateDownload string `json:"url_private_download"`
			Permalink          string `json:"permalink"`
			PermalinkPublic    string `json:"permalink_public"`
		} `json:"files,omitempty"`
	} `json:"messages"`
}

func (*ConversationRepliesJSON) ToSlackFiles added in v0.2.0

func (rs *ConversationRepliesJSON) ToSlackFiles() SlackFiles

type Message

type Message struct {
	Type     string `json:"type"`
	Text     string `json:"text"`
	User     string `json:"user"`
	ThreadTs string `json:"thread_ts,omitempty"`
}

func (*Message) IsTextMessage

func (m *Message) IsTextMessage() bool

func (*Message) IsThread

func (m *Message) IsThread() bool

type SlackFile added in v0.2.0

type SlackFile struct {
	Name               string
	Mimetype           string
	UrlPrivateDownload string
}

type SlackFiles added in v0.2.0

type SlackFiles []SlackFile

func FetchSlackFiles added in v0.2.0

func FetchSlackFiles(token, channelId, ts string) (SlackFiles, error)

type SlackThread

type SlackThread struct {
	Text string
	Ts   string
}

func (*SlackThread) FirstLine

func (t *SlackThread) FirstLine() string

type SlackThreads

type SlackThreads []SlackThread

func FetchSlackThreads

func FetchSlackThreads(token string, channelId string) (SlackThreads, error)

Jump to

Keyboard shortcuts

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