app

package
v0.0.0-...-69810a0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package app contains all the libraries used by the main Phabulous executable.

The top-level services of the application are located here as well.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectorManager

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

A ConnectorManager can be seen as an aggregator of Connector objects. It implements the Connector interface by delegating every method to its registered connectors. This allows clients to use multiple connectors at once with ease.

While one could technically register a ConnectorManager as part of another manager, it is not extremely useful at this point.

func (*ConnectorManager) Boot

func (c *ConnectorManager) Boot() error

Boot boots all the registered connectors. If one of them fails, the operation is interrupted and the first error is returned.

func (*ConnectorManager) LoadModules

func (c *ConnectorManager) LoadModules(modules []interfaces.Module)

LoadModules loads the provided modules on all the registered connectors.

func (*ConnectorManager) Post

func (c *ConnectorManager) Post(
	channelName string,
	storyText string,
	icon messages.Icon,
	asUser bool,
)

Post posts a text message.

func (*ConnectorManager) PostImage

func (c *ConnectorManager) PostImage(
	channelName string,
	storyText string,
	imageURL string,
	icon messages.Icon,
	asUser bool,
)

PostImage posts a message with an attached image.

func (*ConnectorManager) PostOnFeed

func (c *ConnectorManager) PostOnFeed(storyText string) error

PostOnFeed posts a message on the bot's "feed" channel.

func (*ConnectorManager) RegisterConnector

func (c *ConnectorManager) RegisterConnector(connector interfaces.Connector)

RegisterConnector adds a Connector to the list of connectors managed by this manager.

type EngineService

type EngineService struct {
	Front  controllers.FrontController `inject:"inline"`
	Feed   controllers.FeedController  `inject:"inline"`
	Config *confer.Config              `inject:""`
}

EngineService provides the API engine

func (*EngineService) New

func (e *EngineService) New() *gin.Engine

New creates a new instance of an API engine

type Phabulous

type Phabulous struct {
	Config           *confer.Config            `inject:""`
	Engine           *EngineService            `inject:""`
	Serve            *ServeService             `inject:""`
	Logger           *logrus.Logger            `inject:""`
	GonduitFactory   *factories.GonduitFactory `inject:""`
	ConnectorManager *ConnectorManager         `inject:""`
}

Phabulous is the root node of the DI graph

func (*Phabulous) Boot

func (p *Phabulous) Boot(c *cli.Context)

Boot the upper part of the application.

type ServeService

type ServeService struct {
	Engine *EngineService `inject:""`
	Config *confer.Config `inject:""`
	Logger *logrus.Logger `inject:""`
	App    *Phabulous     `inject:""`
}

ServeService provides the serve command

func (*ServeService) Run

func (s *ServeService) Run(c *cli.Context)

Run boots the application and starts up the API server.

Directories

Path Synopsis
Package gonduit contains additional Conduit calls not provided by the gonduit package due to the usage of third-party methods not provided by a vanilla Phabricator instance.
Package gonduit contains additional Conduit calls not provided by the gonduit package due to the usage of third-party methods not provided by a vanilla Phabricator instance.
Package interfaces contains most of the interfaces used by Phabulous' components.
Package interfaces contains most of the interfaces used by Phabulous' components.
dev
testing
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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