Documentation
¶
Index ¶
- Constants
- func DefaultAuthConfig() *auth.Config
- func DefaultEnvBool(key string, defaultValue bool) bool
- func DefaultEnvStr(key, defaultValue string) string
- func NewDefaultLogger() zerolog.Logger
- func WithBubblyUI(fs *embed.FS) func(*BubblyConfig)
- func WithVersion(version *Version) func(*BubblyConfig)
- type BubblyConfig
- type CLIConfig
- type ClientConfig
- type NATSServerConfig
- type Provider
- type ReleaseConfig
- type ServerConfig
- type StoreConfig
- type Version
Constants ¶
const ( DefaultCLINoColorToggle = false DefaultCLIDebugToggle = false )
Default CLI configuration
const ( DefaultBubblyDir = ".bubbly" DefaultReleaseSpec = "" // default spec is under bubbly dir DefaultReleaseProject = "default" DefaultOrganization = "bubbly" )
Default Bubbly Release configuration
const ( DefaultServerHost = "" DefaultServerPort = "8111" )
Default Bubbly Server configuration
const ( DefaultStoreProvider = "sqlite" DefaultRetryAttempts = 5 DefaultRetrySleep = 1 )
Default store configuration
const ( DefaultPostgresAddr = "postgres:5432" DefaultPostgresUser = "postgres" DefaultPostgresPassword = "postgres" DefaultPostgresDatabase = "bubbly" )
Default store configuration for Postgres
const ( DefaultNATSServerHTTPPort = "8222" DefaultNATSServerPort = "4223" )
Default configuration for NATS Server
const ( DefaultClientAuthToken = "" DefaultBubblyAddr = "http://localhost:8111" DefaultNATSAddr = "localhost:4223" )
Default configuration for the bubbly client config
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthConfig ¶
func DefaultEnvBool ¶
DefaultEnvBool reads a boolean value from the environment and falls back to the default value if not provided.
func DefaultEnvStr ¶
DefaultEnvStr reads a string value from the environment and falls back to the default value if not provided.
func NewDefaultLogger ¶
NewDefaultLogger sets up a default logger
func WithBubblyUI ¶
func WithBubblyUI(fs *embed.FS) func(*BubblyConfig)
func WithVersion ¶
func WithVersion(version *Version) func(*BubblyConfig)
Types ¶
type BubblyConfig ¶
type BubblyConfig struct { // UI stores the embedded bubbly frontend UI *embed.FS // Logger stores the global bubbly logger Logger zerolog.Logger ReleaseConfig *ReleaseConfig ServerConfig *ServerConfig // Store provider configuration StoreConfig *StoreConfig ClientConfig *ClientConfig CLIConfig *CLIConfig AuthConfig *auth.Config Version *Version }
BubblyConfig holds global bubbly state that is required to be injected into functions throughout the codebase.
func NewBubblyConfig ¶
func NewBubblyConfig(opts ...func(*BubblyConfig)) *BubblyConfig
NewBubblyConfig sets up a default Bubbly Config
func (*BubblyConfig) UpdateLogLevel ¶
func (bCtx *BubblyConfig) UpdateLogLevel(level zerolog.Level)
UpdateLogLevel is a convenience method for updating the log level of the zerolog.Logger managed by a BubblyConfig instance
type CLIConfig ¶
func DefaultCLIConfig ¶
func DefaultCLIConfig() *CLIConfig
type ClientConfig ¶
func DefaultClientConfig ¶
func DefaultClientConfig() *ClientConfig
func (*ClientConfig) GraphQL ¶
func (c *ClientConfig) GraphQL() string
func (*ClientConfig) V1 ¶
func (c *ClientConfig) V1() string
type NATSServerConfig ¶
func DefaultNATSServerConfig ¶
func DefaultNATSServerConfig() *NATSServerConfig
DefaultNATSServerConfig creates a NATSServerConfig struct from defaults or, preferentially, from provided environment variables.
type ReleaseConfig ¶
type ReleaseConfig struct { // BubblyDir points to the .bubbly directory BubblyDir string // ReleaseSpec points to the release specification file explicitly // (default $BUBBLY_DIR/release.json) ReleaseSpec string // Project defines the bubbly project Project string }
ReleaseConfig is a struct storing local bubbly runtime configs, such as the localtion of the .bubbly directory containing the release specification and local adapters
func DefaultReleaseConfig ¶
func DefaultReleaseConfig() *ReleaseConfig
DefaultReleaseConfig creates a ReleaseConfig struct from defaults or, preferentially, from provided environment variables.
type ServerConfig ¶
ServerConfig is a struct storing the server information.
func DefaultServerConfig ¶
func DefaultServerConfig() *ServerConfig
DefaultServerConfig creates a ServerConfig struct from defaults or, preferentially, from provided environment variables.
func (ServerConfig) HostURL ¶
func (s ServerConfig) HostURL() string
type StoreConfig ¶
type StoreConfig struct { Provider Provider PostgresAddr string PostgresUser string PostgresPassword string PostgresDatabase string CockroachAddr string CockroachUser string CockroachPassword string CockroachDatabase string RetrySleep int RetryAttempts int }
StoreConfig stores the configuration of a bubbly store, used to interact with a backend database
func DefaultStoreConfig ¶
func DefaultStoreConfig() *StoreConfig
DefaultStoreConfig creates a StoreConfig struct from defaults or, preferentially, from provided environment variables.
type Version ¶
Version contains the SHA1 value for the commit in the Bubbly Git repo from which the current running binary was built. If the commit was tagged, the tag is also included.
func NewVersionInfo ¶
func NewVersionInfo() *Version
NewVersionInfo returns a reference to the Version structure, populated with information provided at compile time.