controller

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Context        context.Context
	Providers      providers.Providers
	Store          *store.Store
	Slack          slack.Slack
	TaskController TaskController
}

Controller holds the necessary clients to run the app and handle requests

func New

func New(ctx context.Context, cfg config.Config) (c Controller, err error)

New creates a new controller

func (Controller) ModalHandler

func (c Controller) ModalHandler(w http.ResponseWriter, r *http.Request)

ModalHandler handlers slack modal payloads

func (Controller) ScheduleTask

func (c Controller) ScheduleTask(tt TaskType, args ...interface{})

ScheduleTask ..

func (Controller) SelectHandler

func (c Controller) SelectHandler(w http.ResponseWriter, r *http.Request)

SelectHandler handles slack selector payloads

func (Controller) SlashHandler

func (c Controller) SlashHandler(w http.ResponseWriter, r *http.Request)

SlashHandler handles slash command payloads

func (*Controller) TaskHandlerRepositoriesRefsUpdate

func (c *Controller) TaskHandlerRepositoriesRefsUpdate()

TaskHandlerRepositoriesRefsUpdate updates all Repositories in the local store with refs fetched from its associated git provider

func (*Controller) TaskHandlerRepositoriesUpdate

func (c *Controller) TaskHandlerRepositoriesUpdate(wg *sync.WaitGroup)

TaskHandlerRepositoriesUpdate updates the local store with repositories fetched from configured git providers

func (*Controller) TaskHandlerRepositoryRefsUpdate

func (c *Controller) TaskHandlerRepositoryRefsUpdate(wg *sync.WaitGroup, rk providers.RepositoryKey)

TaskHandlerRepositoryRefsUpdate updates a Repository in the local store with refs fetched from its associated git provider

func (*Controller) TaskHandlerSlackUsersEmailsUpdate

func (c *Controller) TaskHandlerSlackUsersEmailsUpdate()

TaskHandlerSlackUsersEmailsUpdate updates the local store with slack users emails fetched from the Slack API and local configuration (for custom aliases)

type TaskController

type TaskController struct {
	Factory taskq.Factory
	Queue   taskq.Queue
	TaskMap *taskq.TaskMap
}

TaskController holds task related clients

func NewTaskController

func NewTaskController() (t TaskController)

NewTaskController initializes and returns a new TaskController object

type TaskType

type TaskType string

TaskType represents the type of a task

const (
	// TaskTypeRepositoriesUpdate updates the local store with repositories fetched from
	// configured git providers
	TaskTypeRepositoriesUpdate TaskType = "RepositoriesUpdate"

	// TaskTypeRepositoriesRefsUpdate updates all Repositories in the local store with refs fetched from
	// their associated git provider
	TaskTypeRepositoriesRefsUpdate TaskType = "RepositoriesRefsUpdate"

	// TaskTypeRepositoryRefsUpdate updates a Repository in the local store with refs fetched from
	// its associated git provider
	TaskTypeRepositoryRefsUpdate TaskType = "RepositoryRefsUpdate"

	// TaskTypeSlackUsersEmailsUpdate updates the local store with slack users emails fetched from
	// the Slack API and local configuration (for custom aliases)
	TaskTypeSlackUsersEmailsUpdate TaskType = "SlackUsersEmailsUpdate"
)

Jump to

Keyboard shortcuts

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