types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueChangedTopic = "app-template.value.changed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	// PreStart called before the service is started, register http endpoints etc. here
	PreStart() error
	// PostStart called after the service has started, run any background processes etc. here
	PostStart() error
	// PreStop called before the service shuts down, use this to gracefully stop your service
	PreStop() error
}

App contract for the app entry point

type AppEventManager

type AppEventManager interface {
	DispatchValueChangedEvent(ctx context.Context, value string) error
	SubscribeToValueChanges(ctx context.Context) (eventCh chan string, close func(), err error)
}

AppEventManager handles applications events

type AppService

type AppService interface {
	GQLSetValue(ctx context.Context, input model.ValueInput) (*model.ValueOutput, error)
	GQLGetValue(ctx context.Context) (*model.ValueOutput, error)
	GQLSubscribeToValueChanges(ctx context.Context) (<-chan *model.ValueOutput, error)
}

AppService contract for graphql handlers and other app specific business logic

type Config

type Config struct {
	Routing *Routing `yaml:"routing"`
	WebDir  string   `yaml:"web_dir"`
}

type Option

type Option func(o *Options)

func WithConfig

func WithConfig(cfg *Config) Option

func WithService

func WithService(svc *service.AppService) Option

type Options

type Options struct {
	Config  *Config
	Service *service.AppService
}

type Routing

type Routing struct {
	Proxy      bool   `yaml:"proxy"`
	WebURL     string `yaml:"web_url"`
	APIURL     string `yaml:"api_url"`
	GatewayURL string `yaml:"gateway_url"`
}

Jump to

Keyboard shortcuts

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