Documentation
¶
Overview ¶
Package natssetup is the setup group under osapi nats: osapi nats setup, which creates osapi's streams and buckets on a NATS server that osapi does not run, such as an existing cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Group = command.Register(command.Define( "setup", "Create osapi's streams and buckets on a NATS server", command.Flat(), command.Under(command.ParentNATS), command.Uses[Deps](), command.Method[Input, Output]("setup"). Short("Create osapi's streams and buckets on a NATS server"). Long("It connects as the controller does, with `controller.nats`: its host,\n"+ "port, namespace and auth. Run it one time before you start the controller\n"+ "and the agents with that server.\n\n"+ "Run it again after you change the settings of a stream or a bucket. Each\n"+ "stream and bucket is created or updated to match the config, so running it\n"+ "again changes nothing. `osapi nats start` does the same for the\n"+ "embedded server when the server starts. Thus a deployment that runs the\n"+ "NATS server of osapi does not need this command."). Example("-f /etc/osapi/osapi.yaml"). Prints(sampleSetup). NoCheck("it makes the streams and buckets of osapi, which no osapi command lists: "+ "the suite's controller and agent use each of them, and a second run changes nothing"). Handle(Setup), ))
Group is the setup group's definition. It is flat, Under nats, so its method is osapi nats setup.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Config config.Config
Logger *slog.Logger
Prepare func(
ctx context.Context,
log *slog.Logger,
opts *natsclient.Options,
namespace string,
cfg config.NATS,
) error
// Audit writes an entry to the audit log of the controller, or is nil.
// It fails when NATS cannot be reached, such as before NATS starts.
Audit func(ctx context.Context, e audit.Entry) error
}
Deps is what setup uses: the config, the log, and what prepares the server, bus.Prepare.
type Input ¶
type Input struct{}
Input is the input of setup, which has none: the config is its input.