Skip to content

adfinis/bastion-go

Repository files navigation

Bastion-go

Tests Go Report Card Go Reference

A go library to interact with The Bastion.

Installation

go get github.com/adfinis/bastion-go

Example

package main

import (
	"log"
	"os"

	"github.com/adfinis/bastion-go"
)

func main() {
    cfg := bastion.Config{
		Host:                  "bastion.mycompany.org",
		Port:                  22,
		Username:              "clarkkent",
	}

    client, err := bastion.New(&cfg, bastion.WithPrivateKeyFileAuthWithPassphrase(
		"/path/to/private/key",
		os.Getenv("BASTION_PRIVATE_KEY_PASSPHRASE"),
	))
	if err != nil {
		log.Fatalln(err)
	}

	groupServers, err := client.GroupListServers("mygroup1")
	if err != nil {
  		log.Fatalln(err)
	}
	_ = groupServers
}

About

Golang client for The Bastion

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •