client

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const CSSFile = "output.css"
View Source
const ConfigDir = "./config"
View Source
const ConfigFileName = "config.json"
View Source
const CredentialFileName = "credentials.json"
View Source
const HtmlDir = "html"
View Source
const TemplateDir = "template"
View Source
const TemplateFile = "happeninghound-viewer.html"

Variables

This section is empty.

Functions

func BotJoinedEventHandler

func BotJoinedEventHandler(botID string) socketmode.SocketmodeHandlerFunc

func ChannelArchiveHandler added in v0.5.3

func ChannelArchiveHandler(channels *Channels, gdrive *GDrive) socketmode.SocketmodeHandlerFunc

func MessageEventHandler

func MessageEventHandler(channels *Channels, botID string, gdrive *GDrive) socketmode.SocketmodeHandlerFunc

MessageEventHandler チャンネルごとのメッセージ受信ハンドラー: MessageEventHandler はメッセージイベントを処理します。

func Run

func Run(ctx context.Context) error

func SlashCommandHandler added in v0.5.0

func SlashCommandHandler(channels *Channels, gdrive *GDrive, basedir string) socketmode.SocketmodeHandlerFunc

Types

type Channels

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

Channels はチャンネルデータの管理を行います。

func NewChannels

func NewChannels(basedir, authorID string) (*Channels, error)

NewChannels は Channels 構造体の新しいインスタンスを作成します。

func (*Channels) AppendMessage

func (c *Channels) AppendMessage(channelName, jsonstring string, gdrive *GDrive) error

func (*Channels) CreateFilePathForMessage added in v0.2.0

func (c *Channels) CreateFilePathForMessage(channelName string, timestamp string, index int, filetype string) string

func (*Channels) CreateHtmlFile added in v0.4.0

func (c *Channels) CreateHtmlFile(channelName string, gdrive *GDrive) error

func (*Channels) CreateImageFileName added in v0.3.0

func (c *Channels) CreateImageFileName(timestamp string, index int, filetype string) string

func (*Channels) CreateImageFilePath added in v0.2.0

func (c *Channels) CreateImageFilePath(channelName string, timestamp string, index int, filetype string) string

func (*Channels) CreateLocalFile added in v0.3.0

func (c *Channels) CreateLocalFile(channelName string, timestamp string, i int, fileType string) (*os.File, error)

type Config

type Config struct {
	AppToken string `json:"app_token"`
	BotToken string `json:"bot_token"`
	Debug    bool   `json:"debug"`
	BaseDir  string `json:"baseDir"`
	AuthorID string `json:"author_id"`
}

type Entry added in v0.4.0

type Entry struct {
	Timestamp   string   `json:"timestamp"`
	Message     string   `json:"message"`
	ChannelId   string   `json:"channel.id"`
	ChannelName string   `json:"channel.name"`
	Files       []string `json:"files"`
}

Entry jsonlファイルのデータ読み込み用構造体

func ParseEntry added in v0.4.0

func ParseEntry(jsonl string) Entry

ParseEntry 1行jsonをEntryに変換

func (Entry) MessageWithLinkTag added in v0.5.5

func (e Entry) MessageWithLinkTag() template.HTML

MessageWithLinkTag メッセージに含まれるリンクをHTMLタグに変換

func (Entry) Timestamp2String added in v0.4.0

func (e Entry) Timestamp2String() string

Timestamp2String Slackから取得した日付データを文字列に成形

type GDrive added in v0.3.0

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

func NewGDrive added in v0.3.0

func NewGDrive(configPath string, basedir string) *GDrive

NewGDrive GoogleDriveクライアント生成

func (GDrive) CreateImageFile added in v0.3.0

func (g GDrive) CreateImageFile(name string, parent string, filepath string) error

CreateImageFile 画像ファイルをimageDirにアップロードする

func (GDrive) UploadFile added in v0.3.0

func (g GDrive) UploadFile(name string, filepath string) error

UploadFile ファイルをtargetDirにアップロードする

func (GDrive) UploadHtmlFile added in v0.4.0

func (g GDrive) UploadHtmlFile(name string, filepath string) error

UploadHtmlFile HTMLファイルをhtmlDirにアップロードする

Jump to

Keyboard shortcuts

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