package
1.54.0
Repository: https://github.com/lacework/go-sdk.git
Documentation: pkg.go.dev

# README

Lacework Config

A Go library to manage the Lacework configuration file ($HOME/.lacework.toml)

Usage

Download the library into your $GOPATH:

$ go get github.com/lacework/go-sdk/lwconfig

Import the library into your tool:

import "github.com/lacework/go-sdk/lwconfig"

Examples

Load the default Lacework configuration file and detect if there is a profile named test:

package main

import (
	"fmt"
	"os"

	"github.com/lacework/go-sdk/lwconfig"
)

func main() {
	profiles, err := lwconfig.LoadProfiles()
	if err != nil {
		fmt.Printf("Error trying to load profiles: %s\n", err)
		os.Exit(1)
	}

	config, ok := profiles["test"]
	if !ok {
		fmt.Println("You have a test profile configured!")
	} else {
		fmt.Println("'test' profile not found")
	}
}

Look at the examples/ folder for more examples.

# Functions

DefaultConfigPath returns the default path where the Lacework config file is located, which is at $HOME/.lacework.toml.
LoadProfiles loads all the profiles from the default location ($HOME/.lacework.toml).
LoadProfilesFrom loads all the profiles from the provided location.
StoreAt stores the provided profiles into the selected configuration file.
StoreProfileAt updates a single profile from the provided configuration file.

# Constants

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

# Structs

Profile represents a single profile within a configuration file.

# Type aliases

Profiles is the representation of the $HOME/.lacework.toml Example: [default] account = "example" api_key = "EXAMPLE_0123456789" api_secret = "_0123456789" [dev] account = "dev" api_key = "DEV_0123456789" api_secret = "_0123456789" [prod] account = "coolcorp" subaccount = "prod-business" api_key = "PROD_0123456789" api_secret = "_0123456789" version = 2.