Documentation
¶
Index ¶
- Constants
- Variables
- type FlyioClustering
- type FlyioHubAndSpoke
- type Option
- func WithInProcessClient(b bool) Option
- func WithJetStream(dir string) Option
- func WithLogging(b bool) Option
- func WithNATSServerOptions(natsServerOpts *server.Options) Option
- func WithPlatformAdapter(ctx context.Context, enable bool, platformCfgr PlatformConfigurator) Option
- func WithTimeout(t time.Duration) Option
- type PlatformConfigurator
- type Server
Constants ¶
const ( ClusterPort int = 4244 GatewayPort int = 7244 LeafNodePort int = 7422 )
Variables ¶
var Client *nats.Conn
Global variable of the nats client created from Run().
If you are starting multiple embedded NATS servers, it's recommended to use the client returned from Run() as this Client will just be from the last invocation of Run().
var ErrEnvVarNotFound = errors.New("Platform ENV not found")
A platform specific environment variable could not be found. This should only occur if you are trying to use a platform adapter like AdapterFlyio() while not actually deploying on Flyio.
If this error does occur when still deploying on the correct platform respective to your Adapter, this may be that the platform changed their environment implementation. If so, file an issue.
var ErrPlatformImplementationChanged = errors.New("Platform implementation changed")
Should only occur when a platform changes something in their implementation. Pillow makes assumeptions that platforms tooling will not change, but if it does this error is returned.
Functions ¶
This section is empty.
Types ¶
type FlyioClustering ¶
type FlyioClustering struct {
// The name to be used for clustering. Appended will be `-<REGION>` where REGION is the
// Flyio region this cluster is in.
ClusterName string
}
FlyioClustering will cluster all intra-region machines, and super cluster regions together. Note, if JetStream is enabled ALL regions must have >= 3 machines.
type FlyioHubAndSpoke ¶
type FlyioHubAndSpoke struct {
// The name to be used for the primary region cluster.
ClusterName string
}
FlyioHubAndSpoke will cluster all machines in your primary region, and then all other regions will have their machines individually connect to your primary region cluster as leaf nodes.
Additionally, the primary region cluster will have the JS domain of "hub" and the leaf nodes will have the structure of "leaf-<REGION>-<MACHINE_ID>"
type Option ¶
type Option func(*options) error
func WithInProcessClient ¶
If enabled the returned client from Run() will communicate in-process and not over the network layer
func WithNATSServerOptions ¶
Apply your own NATs Server Options. Note, this will override any existing options, so it's recommended to place first in the list of options in Run().
func WithPlatformAdapter ¶
func WithPlatformAdapter(ctx context.Context, enable bool, platformCfgr PlatformConfigurator) Option
func WithTimeout ¶
Duration to wait for embedded NATS to start. Defaults to 5 seconds if omitted