GoAWS
Documentation for GoAWS.
Configuration
To configure the server, pass config. It is suggested to modify the default config, for example:
config = GoAWS.default_config()
config["Local"]["LogToFile"] = true
server = Server(; config)
# or `with_go_aws(; config) do ....`To see what configuration options are available, see the example config in the GoAWS source: https://github.com/Admiral-Piett/goaws/blob/v0.4.5/app/conf/goaws.yaml.
Troubleshooting steps
- Create the server with
verbose=trueto print messages tostdout/stderr. - Call
runwithwait=falseto error if the process errors. - Do not pass floating-point values as the timeout for
SQS.change_message_visibilitywith AWS.jl. Those are required to be integers by AWS and GoAWS in particular seems to handle them poorly (go panics without a clear error message).
API documentation
GoAWS.GoAWSConfig — TypeGoAWSConfig <: AWS.AbstractAWSConfig
GoAWSConfig(; endpoint=GoAWS.DEFAULT_ADDRESS, region="us-east-2")
GoAWSConfig(s::Server)Constructs an AbstractAWSConfig for use with AWS.jl, to configure SQS and SNS to use GoAWS.
Examples
Here we demonstrate using the config with a local server we launch as a subprocess.
using GoAWS, AWS
@service SQS
server = GoAWS.Server()
aws_config = GoAWSConfig(server)
run(server; wait=false)
# ... now we can use the config:
SQS.create_queue("my_queue"; aws_config)
kill(server) # when you are doneOne can also use a GoAWSConfig with a GoAWS server launched outside of the Julia process. Simply set the endpoint and region using the keyword argument constructor:
aws_config = GoAWSConfig(; endpoint="localhost:5203", region="us-east-1")
# ... now we can use the config:
SQS.create_queue("my_queue"; aws_config)GoAWS.Server — MethodGoAWS.Server(; cmd=goaws_jll.goaws(),
config=GoAWS.default_config(),
address=GoAWS.DEFAULT_ADDRESS,
region="us-east-2",
detach::Bool=false,
verbose::Bool=false)A data structure for managing a goaws server process.
The passed-in config will be mutated in-place to add the host and port from address, and the region.
Supports run, as well as kill, getpid, success, process_exited, and process_running by forwarding to the process created by run.
Can also be used with with_go_aws.
GoAWS.default_config — MethodGoAWS.default_config() -> Dict{Any,Any}Provides a copy of the default configuration used in Server and with_go_aws.
GoAWS.with_go_aws — Methodwith_go_aws(f; address=DEFAULT_ADDRESS, region="us-east-2", kw...)Starts up a GoAWS server, runs f(go_aws_config::AbstractAWSConfig), with an AWS.jl-compatible config pointing to a live GoAWS server, and destroys the server when f() finishes or errors.