server

package
v0.0.0-...-9c0d32c Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package server is a helper package for creating a Horizon server.

It is provided to help start the different services of Horizon that are needed like the store, broker, gateway and any core reconcilers (like accounts).

It also contains some helper methods for things like starting a nats connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Conn *nats.Conn

	NS      *natsutil.Server
	Auth    *auth.Auth
	Broker  *broker.Broker
	Store   *store.Store
	Gateway *gateway.Server

	CtlrSecrets         *hz.Controller
	CtlrAccounts        *hz.Controller
	CtlrServiceAccounts *hz.Controller
	CltrPortals         *hz.Controller
	ActorUsers          *hz.Actor[accounts.User]
}

func Start

func Start(
	ctx context.Context,
	opts ...ServerOption,
) (*Server, error)

func Test

func Test(t *testing.T, ctx context.Context, opts ...ServerOption) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Start

func (s *Server) Start(ctx context.Context, opts ...ServerOption) error

type ServerOption

type ServerOption func(*serverOptions)

func WithAccountsControllerOptions

func WithAccountsControllerOptions(opts ...hz.ControllerOption) ServerOption

func WithAuthOptions

func WithAuthOptions(opts ...auth.Option) ServerOption

func WithDevMode

func WithDevMode() ServerOption

func WithGatewayOptions

func WithGatewayOptions(opts ...gateway.ServerOption) ServerOption

func WithNATSConn

func WithNATSConn(conn *nats.Conn) ServerOption

func WithNATSOptions

func WithNATSOptions(opts ...natsutil.ServerOption) ServerOption

func WithRunAccountsController

func WithRunAccountsController(b bool) ServerOption

func WithRunAuth

func WithRunAuth(b bool) ServerOption

func WithRunBroker

func WithRunBroker(b bool) ServerOption

func WithRunGateway

func WithRunGateway(b bool) ServerOption

func WithRunNATS

func WithRunNATS(b bool) ServerOption

func WithRunStore

func WithRunStore(b bool) ServerOption

func WithRunUsersActor

func WithRunUsersActor(b bool) ServerOption

func WithStoreOptions

func WithStoreOptions(opts ...store.StoreOption) ServerOption

Jump to

Keyboard shortcuts

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