Indent Go SDK

The Indent Go SDK provides your Go applications access to the Indent APIs.

You can install the SDK by running:

go get -u go.indent.com/pkg/auditv1

View the source code on GitHub or Godoc.

After you've installed the SDK, you can include it in your Go application with your Input's DSN. You can put your INPUT_DSN in an environment variable or copy the code from that page:

import (
  "context"
  "go.indent.com/pkg/auditv1"
)

func main() {
  auditv1.Init("https://write.indentapis.com/v1/ZG9jcy1leGFtcGxl")

  auditv1.Write(&auditv1.Event{
    Event: "login.authorize",
    Actor: &auditv1.Actor{Id: "jane.doe@example.com"},
    Resources: []*auditv1.Resource{
      {
        Kind: "app",
        Id:   "aln8t4y5vRu17lVXq0g8",
      },
    },
  })

  // Or send multiple events
  auditv1.WriteEvents(context.Background(), []*auditv1.Event{
      &auditv1.Event{
        Event: "login.authorize",
        Actor: &auditv1.Actor{Id: "jane.doe@example.com"},
        Resources: []*auditv1.Resource{
          {
            Kind: "app",
            Id:   "aln8t4y5vRu17lVXq0g8",
          },
        },
      },
    }
  )
}
func Write(event *Event)

Godoc →

func WriteEvents(ctx context.Context, events []*Event) (err error)

Godoc →

Chat with an engineer or let us know if you’d like to work with Indent in a different language or with a specific framework.