gong

package
v0.0.0-...-fc13fb6 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 15 Imported by: 0

README

Gong connector

Read

Read is used to list all records of a given type. For example, if you want to list all users, you would use the Read method with the users object or calls.

Example Usage

gong := GetGongConnector(context.Background(), DefaultCredsFile)

	config := connectors.ReadParams{
		ObjectName: "calls", 
		Fields:     []string{"url"},
	}

	result, err := gong.Read(context.Background(), config)
	if err != nil {
		slog.Error("Error reading from Gong", "error", err)
		return 1
	}

Documentation

Index

Constants

View Source
const ApiVersion = "v2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	BaseURL string
	Module  common.Module
	Client  *common.JSONHTTPClient
}

func NewConnector

func NewConnector(opts ...Option) (conn *Connector, outErr error)

func (*Connector) HTTPClient

func (c *Connector) HTTPClient() *common.HTTPClient

func (*Connector) JSONHTTPClient

func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient

JSONHTTPClient returns the underlying JSON HTTP client.

func (*Connector) ListObjectMetadata

func (c *Connector) ListObjectMetadata(
	ctx context.Context, objectNames []string,
) (*common.ListObjectMetadataResult, error)

func (*Connector) Provider

func (c *Connector) Provider() providers.Provider

Provider returns the connector provider.

func (*Connector) Read

func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)

func (*Connector) String

func (c *Connector) String() string

func (*Connector) Write

func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)

Write only supports creating Calls.

type Option

type Option = func(params *parameters)

Option is a function which mutates the connector configuration.

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

func WithClient

func WithClient(ctx context.Context, client *http.Client,
	config *oauth2.Config, token *oauth2.Token, opts ...common.OAuthOption,
) Option

type ResponseError

type ResponseError struct {
	RequestId string   `json:"requestId"`
	Errors    []string `json:"errors"`
}

func (ResponseError) CombineErr

func (r ResponseError) CombineErr(base error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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