gosh

module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: MIT

README

gosh

Gosh is a Go client library for accessing the SiteHost V1.1 API

Installation

go get -u https://github.com/sitehostnz/gosh

Example

package main

import (
	"context"
	"fmt"

	"github.com/sitehostnz/gosh"

	"log"
	"net/http"
	"os"
)

func main() {
    apiKey := os.Getenv("SH_APIKEY")
    clientId := os.Getenv("SH_CLIENTID")

    sh := gosh.NewClient(apiKey, clientId)
    ctx = context.Background()
    
    server, err := sh.Servers.Get(ctx, "ch-server1")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("%v", server)
}

Documentation

See our documentation for detailed information about API v1.1.

Contributing

If you're interested in contributing to our project:

License

GoSH is distributed under MIT.

Directories

Path Synopsis
pkg
api
Package api provides the functions to work with SiteHost API.
Package api provides the functions to work with SiteHost API.
api/cloud/server
Package server provides access to the `/cloud/stack/server` API endpoint.
Package server provides access to the `/cloud/stack/server` API endpoint.
api/cloud/stack
Package stack represents a cloud stack operations under the `/cloud/stack` API endpoint.
Package stack represents a cloud stack operations under the `/cloud/stack` API endpoint.
api/cloud/stack/environment
Package environment represents a cloud stack environment operations under the `/cloud/stack/environment` API endpoint.
Package environment represents a cloud stack environment operations under the `/cloud/stack/environment` API endpoint.
api/dns
Package dns represents our SiteHost `/dns` API endpoint.
Package dns represents our SiteHost `/dns` API endpoint.
api/info
Package info represents our SiteHost `/api` API endpoint.
Package info represents our SiteHost `/api` API endpoint.
api/job
Package job represents our SiteHost `/job` endpoint
Package job represents our SiteHost `/job` endpoint
api/server
Package server represents our SiteHost `/server` API endpoint.
Package server represents our SiteHost `/server` API endpoint.
api/ssh/key
Package key represents our SiteHost `/ssh/key` API endpoint.
Package key represents our SiteHost `/ssh/key` API endpoint.
models
Package models hosts all sharing models between api endpoints.
Package models hosts all sharing models between api endpoints.
utils
Package utils contains our utilities functions.
Package utils contains our utilities functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL