Code Monkey home page Code Monkey logo

segment-apis-go's Introduction

segment-config-go

Travis CI Go Report Card GoDoc

segment-config-go is a Go client library for accessing the Segment Config API.

This library allows you to do the following programmatically:

  • List all your Segment sources and destinations
  • Create sources
  • Create or modify destinations
  • Enable and disable destinations

Authentication

segment-config-go requires a Segment Personal Access Token for authentication. You can generate one with the appropriate access by following the steps in the Segment documentation

Usage

import "github.com/ajbosco/segment-config-go/segment"

Construct a new Segment client with your access token and Segment workspace. For example:

accessToken :=  os.Getenv("ACCESS_TOKEN")
segmentWorkspace :=  os.Getenv("SEGMENT_WORKSPACE")

client := segment.NewClient(accessToken, segmentWorkspace)

Now you can interact with the API to do things like list all sources in your workspace:

sources, err := c.ListSources()

List destinations for a given source:

destinations, err := c.ListDestinations("your-source")

Create a new source:

source, err := c.CreateSource("your-source", "catalog/sources/javascript")

Create a new destination:

source, err := c.CreateDestination("your-source", "google-analytics", "cloud", false, nil)

segment-apis-go's People

Contributors

ajbosco avatar dependabot-preview[bot] avatar rae89 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.