Skip to content

square/anomalo-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anomalo-Go

A Go client for Anomalo.

This package exists primarily to support the Terraform provider. Consequently, it implements only a subset of the Anomalo API.

Go Reference

Table of Contents

Installation

Run go install github.com/square/anomalo-go, then (if using modules) go get && go mod tidy

Getting Started

Quick Start

anomalo-go makes it easier to call the Anomalo API. It includes structs for request & response objects and some convenience methods that make the API easier to work with.

To get started, you'll need to provide Anomalo API credentials. If you don't have them already, ask your Anomalo administrator or representative.

A minimal example looks like this:

package main

import "github.com/square/anomalo-go"

func main() {
	client, _ := anomalo.LoadClient() // Checks for credentials anomalo_secrets.json and environment variables.
	fmt.Println(client.Ping())
}

The package will first check for a JSON formatted credential file at anomalo_secrets.json. If the file does not exist, it will look for environment variables named ANOMALO_API_SECRET_TOKEN and ANOMALO_INSTANCE_HOST. The anomalo_secrets.json file should have the following format:

{
  "token": "thisIsAToken",
  "host": "https://anomalo.example.com"
}

Executing this example should print a struct containing the word "Pong".

Documentation

Refer to Anomalo documentation for most the behavior or most methods. The code in client.go contains documentation for methods like GetCheckByStaticID that are not available in the Anomalo API.

Appendix

Contributions are welcome. This package is not maintained by Anomalo, and is not guaranteed to be up to date with changes Anomalo makes to their API.

Brought to you by Square GitHub logo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages