launcher

package
v0.0.0-...-d36796e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Launch

func Launch(createServer func() rpc.Server) (err error)

Launch is the entry point for a service. This function should be called from the main generated by shana toolchain.

func OnConnect

func OnConnect(f Func)

OnConnect registers f as a connecting service callback. All connecting service callbacks will be called before any start-up callbacks and after all config data initialized.

func OnShutdown

func OnShutdown(f Func)

OnShutdown registers f as an shutdown callback. All shutdown callbacks will be called after service is gracefully shutdown and about to exit.

It's not guaranteed to be called as a service can be killed by SIGKILL.

func OnStart

func OnStart(f Func)

OnStart registers f as a start-up callback. All start-up callbacks will be called before service starts serving and after all clients have connected.

func SetMeta

func SetMeta(key, value string)

SetMeta sets the meta data.

Types

type Func

type Func func(context.Context) error

Func is a callback function in life cycle.

Jump to

Keyboard shortcuts

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