garbanzo

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Package garbanzo is a generated GoMock package.

Index

Constants

View Source
const (
	AppDir    = ".garbanzo"
	FeedFile  = "feeds.yml"
	TokenFile = "token"
	SaveFile  = "mark.csv"
)
View Source
const (
	GitHubNotification sourceType = iota
	Feed
)

Variables

This section is empty.

Functions

func NewProxyRouter

func NewProxyRouter(c *Config) *echo.Echo

func NewRouter

func NewRouter(c *Config, templDir string, publicDir string) *echo.Echo

Types

type Config added in v0.2.0

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

func NewConfig added in v0.2.0

func NewConfig(baseDir string) *Config

func (*Config) PutConfDir added in v0.2.1

func (c *Config) PutConfDir()

設定ディレクトリを初期化する。すでにあれば何もしない

type Env

type Env struct {
	AppHost     string `envconfig:"APP_HOST" default:"http://localhost"`
	AppPort     uint16 `envconfig:"APP_PORT" default:"8080"`
	ProxyHost   string `envconfig:"PROXY_HOST" default:"http://localhost"`
	ProxyPort   uint16 `envconfig:"PROXY_PORT" default:"8081"`
	GitHubToken string `envconfig:"GH_TOKEN"`
}
var Envar Env

type Event

type Event struct {
	Source          sourceType // イベント種別
	NotificationID  string     // 通知ID。HTML要素指定に使うので、数字だけを含むのが安全。記号が含まれるとクリックできなくなる
	UserName        string     // GitHubユーザの名前
	AvatarURL       string     // GitHubユーザのアイコン画像
	Title           string     // 通知のタイトル(プレーンテキスト)
	TitleHTML       string     // 通知のタイトル(HTML)
	Body            string     // 通知の本文
	BodyHTML        string     // 通知の本文(HTML)
	HTMLURL         string     // 通常の、ホストがgithub.comのURL
	ProxyURL        string     // iframe遷移に使う、ホストがリバースプロキシ先で置き換えられたURL
	RepoName        string     // フルリポジトリ名 golang/go
	UpdatedAt       time.Time  // 更新時刻
	UpdatedAtStr    string     // 更新時間(updated_at)
	Category        string     // 種別
	IsNotifyBrowser bool       // ブラウザ通知するかどうか
}

Eventはフロント側で1つ1つの通知表示に必要な項目 将来的にGitHubだけじゃなくなるかもなので、汎用的にしておく

type Events

type Events map[string]*Event // keyにNotificationIDを使う

type GitHub

type GitHub struct {
	Client *github.Client
	// contains filtered or unexported fields
}

type GitHubEventType added in v0.2.2

type GitHubEventType string
const (
	IssuesEventType       GitHubEventType = "issues"
	CommentsEventType     GitHubEventType = "comments"
	PullrequestsEventType GitHubEventType = "pulls"
	ReleasesEventType     GitHubEventType = "releases"
)

type GitHubSubjectType added in v0.2.2

type GitHubSubjectType string
const (
	DiscussionSubjectType  GitHubSubjectType = "Discussion"
	CheckSuitSubjectType   GitHubSubjectType = "CheckSuite"
	PullRequestSubjectType GitHubSubjectType = "PullRequest"
)

type MockclientI

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

MockclientI is a mock of clientI interface.

func NewMockclientI

func NewMockclientI(ctrl *gomock.Controller) *MockclientI

NewMockclientI creates a new mock instance.

func (*MockclientI) EXPECT

func (m *MockclientI) EXPECT() *MockclientIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockclientIMockRecorder

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

MockclientIMockRecorder is the mock recorder for MockclientI.

type Stats added in v0.1.1

type Stats struct {
	ReadCount  int
	EventCount int
	CacheCount int
}

type TemplateRenderer

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

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Jump to

Keyboard shortcuts

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