Documentation ¶
Overview ¶
Package profile is for specific profiles @todo this package is the definition of cruft and should be rewritten in a more elegant way
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Client = &Profile{ Name: "client", Setup: func(ctx *cli.Context) error { SetupDefaults() client.DefaultClient.Init( client.Network(network.Address), ) return nil }, }
Client profile is for any entrypoint that behaves as a client
View Source
var Server = &Profile{ Name: "server", Setup: func(ctx *cli.Context) error { SetupDefaults() auth.DefaultAuth = jwt.NewAuth(auth.Issuer(ctx.String("namespace"))) SetupRules() SetupJWT() if ctx.Args().Get(1) == "registry" { SetupRegistry(memory.NewRegistry()) } else { registry.DefaultRegistry.Init( registry.Addrs("localhost:8000"), ) SetupRegistry(registry.DefaultRegistry) } if ctx.Args().Get(1) == "broker" { SetupBroker(memBroker.NewBroker()) } else { broker.DefaultBroker.Init( broker.Addrs("localhost:8003"), ) SetupBroker(broker.DefaultBroker) } store.DefaultStore = file.NewStore(file.WithDir(filepath.Join(user.Dir, "server", "store"))) SetupConfigSecretKey() config.DefaultConfig, _ = storeConfig.NewConfig(store.DefaultStore, "") // setup events var err error events.DefaultStream, err = memStream.NewStream() if err != nil { logger.Fatalf("Error configuring stream: %v", err) } events.DefaultStore = evStore.NewStore( evStore.WithStore(store.DefaultStore), ) model.DefaultModel = sql.NewModel() runtime.DefaultRuntime = local.NewRuntime() store.DefaultBlobStore, err = file.NewBlobStore() if err != nil { logger.Fatalf("Error configuring file blob store: %v", err) } SetupAccount(ctx) return nil }, }
Functions ¶
func SetupAccount ¶
func SetupAccount(ctx *cli.Context)
func SetupConfigSecretKey ¶
func SetupConfigSecretKey()
func SetupDefaults ¶
func SetupDefaults()
func SetupRegistry ¶
SetupRegistry configures the registry
Types ¶
Click to show internal directories.
Click to hide internal directories.