szaydel / lyvecloud-moved-to-racktopsystems

Seagate Lyve Cloud API library in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seagate Lyve Cloud Go API client

This repository is an early work in progress Seagate Lyve Cloud API client written in Go.

Getting Started

Everything starts with initializing a client. There are two supported starting points. If an authentication token has been obtained previously and is known it could be used with the lyveapi.NewAuthenticatedClient(...) function. Initializing the client without a previously obtained token requires population of a lyveapi.Credentials struct with the account name, access key and secret key and then passing this information to lyveapi.NewClient(...). The second argument to this function is a base URI, which under normal circumstances should be unnecessary. Thus, simply pass in an empty string"".

This snippet is an example for how a new client is initialized:

	cred := lyveapi.NewCredentials(
		"dummyaccount",
		"dummy-access-key",
		"dummy-secret-key",
	)

	client, err := lyveapi.NewClient(cred, "")
	if err != nil {
		// Do something with the error
		return err
	}

Once you have a client, all further operations are methods on the client. Methods are lightly documented, but they can use better documentation to be sure.

About

Seagate Lyve Cloud API library in Go


Languages

Language:Go 99.2%Language:Makefile 0.8%