segment

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// WorkspacesEndpoint is the API endpoint for listing workspaces
	WorkspacesEndpoint = "workspaces"
	// SourceEndpoint is the API endpoint for interacting with sources
	SourceEndpoint = "sources"
	// DestinationEndpoint is the API endpoint for interacting with destinations
	DestinationEndpoint = "destinations"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client manages communication with Segment Config API.

func NewClient

func NewClient(accessToken string, workspace string) *Client

NewClient creates a new Segment Config API client.

func (*Client) CreateDestination

func (c *Client) CreateDestination(srcName string, destName string, connMode string, enabled bool, configs []DestinationConfig) (Destination, error)

CreateDestination creates a new destination for a source

func (*Client) CreateSource

func (c *Client) CreateSource(srcName string, catName string) (Source, error)

CreateSource creates a new source

func (*Client) DeleteDestination added in v0.1.1

func (c *Client) DeleteDestination(srcName string, destName string) error

DeleteDestination deletes a destination for a source from the workspace

func (*Client) DeleteSource

func (c *Client) DeleteSource(srcName string) error

DeleteSource deletes a source from the workspace

func (*Client) GetDestination

func (c *Client) GetDestination(srcName string, destName string) (Destination, error)

GetDestination returns information about a destination for a source

func (*Client) GetSource

func (c *Client) GetSource(srcName string) (Source, error)

GetSource returns information about a source

func (*Client) GetWorkspace

func (c *Client) GetWorkspace() (Workspace, error)

GetWorkspace returns information about a workspace

func (*Client) ListDestinations

func (c *Client) ListDestinations(srcName string) (Destinations, error)

ListDestinations returns all destinations for a source

func (*Client) ListSources

func (c *Client) ListSources() (Sources, error)

ListSources returns all sources for a workspace

func (*Client) UpdateDestination

func (c *Client) UpdateDestination(srcName string, destName string, enabled bool, configs []DestinationConfig) (Destination, error)

UpdateDestination updates an existing destination with a new config

type Destination

type Destination struct {
	Name           string              `json:"name,omitempty"`
	Parent         string              `json:"parent,omitempty"`
	DisplayName    string              `json:"display_name,omitempty"`
	Enabled        bool                `json:"enabled,omitempty"`
	ConnectionMode string              `json:"connection_mode,omitempty"`
	Configs        []DestinationConfig `json:"config,omitempty"`
	CreateTime     time.Time           `json:"create_time,omitempty"`
	UpdateTime     time.Time           `json:"update_time,omitempty"`
}

Destination defines the struct for the destination object

type DestinationConfig

type DestinationConfig struct {
	Name        string      `json:"name,omitempty"`
	DisplayName string      `json:"display_name,omitempty"`
	Value       interface{} `json:"value,omitempty"`
	Type        string      `json:"type,omitempty"`
}

DestinationConfig contains information about how a Destination is configured

type Destinations

type Destinations struct {
	Destinations []Destination `json:"destinations,omitempty"`
}

Destinations defines the struct for the destination object

type LibraryConfig

type LibraryConfig struct {
	MetricsEnabled       bool   `json:"metrics_enabled,omitempty"`
	RetryQueue           bool   `json:"retry_queue,omitempty"`
	CrossDomainIDEnabled bool   `json:"cross_domain_id_enabled,omitempty"`
	APIHost              string `json:"api_host,omitempty"`
}

LibraryConfig contains information about a source's library

type Source

type Source struct {
	Name          string        `json:"name,omitempty"`
	CatalogName   string        `json:"catalog_name,omitempty"`
	Parent        string        `json:"parent,omitempty"`
	WriteKeys     []string      `json:"write_keys,omitempty"`
	LibraryConfig LibraryConfig `json:"library_config,omitempty"`
	CreateTime    time.Time     `json:"create_time,omitempty"`
}

Source defines the struct for the source object

type Sources

type Sources struct {
	Sources []Source `json:"sources,omitempty"`
}

Sources defines the struct for the sources object

type UpdateMask

type UpdateMask struct {
	Paths []string `json:"paths,omitempty"`
}

UpdateMask contains information for updating Destinations

type Workspace

type Workspace struct {
	Name        string    `json:"name,omitempty"`
	DisplayName string    `json:"display_name,omitempty"`
	ID          string    `json:"id,omitempty"`
	CreateTime  time.Time `json:"create_time,omitempty"`
}

Workspace defines the struct for the workspace object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL