backend

package
v0.0.0-...-f46456e Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const GitHubNotifyEntityKind = "GitHubNotify"

GitHubNotifyEntityKind is Kind Name

Variables

This section is empty.

Functions

func PostMessage

func PostMessage(ctx context.Context, text string) error

PostMessage is SlackにMessageをPostする

Types

type AppConfig

type AppConfig struct {
	SlackAPIKey string
	GitHubToken string
}

AppConfig is Application Config

func GetAppConfig

func GetAppConfig(ctx context.Context) *AppConfig

GetAppConfig is Application Configを取得する

type GitHubClient

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

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string) *GitHubClient

func (*GitHubClient) ListNotifications

func (c *GitHubClient) ListNotifications(ctx context.Context) ([]*github.Notification, error)

type GitHubNotifyEntity

type GitHubNotifyEntity struct {
	ID               string    `json:"id" datastore:"-"`
	Reason           string    `json:"reason"`
	Title            string    `json:"title"`
	URL              string    `json:"url"`
	LatestCommentURL string    `json:"latest_comment_url"`
	Type             string    `json:"type"`
	NotifyCount      int       `json:"notifyCount"`
	CreatedAt        time.Time `json:"createdAt"`
	UpdatedAt        time.Time `json:"updatedAt"`
	NotifyAt         time.Time `json:"notifyAt"`
}

GitHubNotifyEntity is GitHubNotifyをDatastoreに保存するためのEntity

type GitHubNotifyStore

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

GitHubNotifyStore is GitHubNotify Entity Store

func NewGitHubNotifyStore

func NewGitHubNotifyStore(ctx context.Context, ds datastore.Client) (*GitHubNotifyStore, error)

func (*GitHubNotifyStore) Get

Get from Datastore

func (*GitHubNotifyStore) Key

func (store *GitHubNotifyStore) Key(gitHubNotifyID string) datastore.Key

Key is Create Key

func (*GitHubNotifyStore) Put

Put to Datastore

type Handlers

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

func NewHandlers

func NewHandlers(ctx context.Context, gitHubNotifyStore *GitHubNotifyStore) (*Handlers, error)

func (*Handlers) CronNotificationsHandler

func (h *Handlers) CronNotificationsHandler(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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