Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lwdomain): export go package #545

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

afiune
Copy link
Contributor

@afiune afiune commented Sep 9, 2021

Use this package to disseminate a domain URL into account, cluster, and whether or not
it is an internal account.

Usage

Download the library into your $GOPATH:

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

Import the library into your tool:

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

Examples

The following URL https://account.fra.lacework.net would be disseminated into:

  • account as the account name
  • fra as the cluster name
package main

import (
	"fmt"
	"os"

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

func main() {
	domain, err := lwdomain.New("https://account.fra.lacework.net")
	if err != nil {
		fmt.Printf("Error %s\n", err)
		os.Exit(1)
	}

	// Output: Lacework Account Name: account
	fmt.Println("Lacework Account Name: %s", domain.Account)
}

Signed-off-by: Salim Afiune Maya [email protected]

@afiune afiune added the feat New feature or request label Sep 9, 2021
@afiune afiune requested a review from a team September 9, 2021 11:24
Use this package to disseminate a domain URL into account, cluster and whether or not
it is an internal account.

== Usage

Download the library into your `$GOPATH`:

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

Import the library into your tool:

```go
import "github.com/lacework/go-sdk/lwdomain"
```

== Examples

The following URL `https://account.fra.lacework.net` would be disseminated into:
* `account` as the account name
* `fra` as the cluster name

```go
package main

import (
	"fmt"
	"os"

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

func main() {
	domain, err := lwdomain.New("https://account.fra.lacework.net")
	if err != nil {
		fmt.Printf("Error %s\n", err)
		os.Exit(1)
	}

	// Output: Lacework Account Name: account
	fmt.Println("Lacework Account Name: %s", domain.Account)
}
```

Signed-off-by: Salim Afiune Maya <[email protected]>
@afiune afiune force-pushed the afiune/ALLY-632/export-lwdomain-pkg branch from dfef08d to ecc146a Compare September 9, 2021 11:26
@afiune afiune merged commit 13fb167 into main Sep 9, 2021
@afiune afiune deleted the afiune/ALLY-632/export-lwdomain-pkg branch September 9, 2021 11:47
@lacework-releng lacework-releng mentioned this pull request Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants