Documentation ¶ Index ¶ func Serve(ctx Ctx, cancel func(), services ...func(Ctx) error) (err error) type Ctx type SetupFunc Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Serve ¶ func Serve(ctx Ctx, cancel func(), services ...func(Ctx) error) (err error) Serve runs given services in parallel until either ctx.Done or any service exits, then it call cancel and wait until all services will exit. Returns error of first service which returned non-nil error, if any. Types ¶ type Ctx ¶ type Ctx = context.Context Ctx is a synonym for convenience. type SetupFunc ¶ type SetupFunc func(Ctx) (interface{}, error) SetupFunc is described in Setup. Source Files ¶ View all Source files concurrent.go Click to show internal directories. Click to hide internal directories.