Categorygithub.com/enix/dothill-api-go/v2
modulepackage
2.0.0
Repository: https://github.com/enix/dothill-api-go.git
Documentation: pkg.go.dev

# README

dothill-api-go

Build status Go Report Card PkgGoDev License

A Go implementation of the Dothill API.

Run tests using our mock server

In order to run tests, you will need to start a mock server by running go run cmd/mock/mock.go. It will expose the mocked api on localhost:8080.

You're now ready to go, just run go test -v to run the tests suite.

You can also run tests with docker-compose, using this command, which is the one used in the CI:

docker-compose up --build --abort-on-container-exit --exit-code-from tests

Both the mocked api and the tests use as username and passwords variables from the environment, or from the .env file if missing. Since the .env file is pre-filled, you should not have to add any environment variable in order to make the tests work.

Test using a live system

This option runs the golang test cases against a live storage system. Two steps are required:

  • Update .env with the correct system IP address and credentials
  • Run go test -v

Another option is to define environment variables, which take precedence over .env values

export TEST_STORAGEIP=http://<ipaddress>
export TEST_USERNAME=<username>
export TEST_PASSWORD=<password>
go test -v
unset TEST_STORAGEIP TEST_PASSWORD TEST_USERNAME

# Packages

No description provided by the author

# Functions

NewClient : Creates a dothill client by setting up its HTTP client.
NewErrorStatus : Creates an error status when response is not available.
NewResponse : Unmarshals the raw data into a typed response object and generate a hash map from fields for optimization.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Client : Can be used to request the dothill API.
No description provided by the author
Object : Typed representation of any XML API object.
Property : Typed representation of any XML API property.
Request : Used internally, and can be used to send custom requests (see Client.Request()).
Response : Typed representation of any XML API response.
ResponseStatus : Final representation of the "status" object in every API response.
Volume : volume-view representation.