api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL string `mapstructure:"base_url"`
}

type Destination

type Destination struct {
	ID        string         `json:"id"`
	Name      string         `json:"name"`
	Connector string         `json:"connector"`
	Config    map[string]any `json:"config"`
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	ClientID string `json:"client_id"`
	Secret   string `json:"secret"`
}

type GetDestinationResponse added in v1.0.0

type GetDestinationResponse struct {
	Total    int           `json:"total"`
	PageSize int           `json:"page_size"`
	Page     int           `json:"page"`
	Result   []Destination `json:"result"`
}

type GetPipelineResponse added in v1.0.0

type GetPipelineResponse struct {
	Total    int        `json:"total"`
	PageSize int        `json:"page_size"`
	Page     int        `json:"page"`
	Result   []Pipeline `json:"result"`
}

type GetSourceResponse added in v1.0.0

type GetSourceResponse struct {
	Total    int      `json:"total"`
	PageSize int      `json:"page_size"`
	Page     int      `json:"page"`
	Result   []Source `json:"result"`
}

type GetTransformResponse added in v1.0.2

type GetTransformResponse struct {
	Total    int         `json:"total"`
	PageSize int         `json:"page_size"`
	Page     int         `json:"page"`
	Result   []Transform `json:"result"`
}

type Pipeline

type Pipeline struct {
	ID                string               `json:"id,omitempty"`
	Name              string               `json:"name"`
	SnapshotNewTables bool                 `json:"snapshot_new_tables"`
	Source            PipelineSource       `json:"source"`
	Destination       PipelineDestination  `json:"destination"`
	Transforms        []*PipelineTransform `json:"transforms"`
}

type PipelineDestination added in v1.0.0

type PipelineDestination struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Connector string `json:"connector"`
}

type PipelineSource added in v1.0.0

type PipelineSource struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Connector string   `json:"connector"`
	Topics    []string `json:"topics"`
}

type PipelineTransform added in v1.0.2

type PipelineTransform struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	StartTime *string `json:"start_time"`
	TopicID   string  `json:"topic_id"`
	Topic     string  `json:"topic"`
}

type Source

type Source struct {
	ID        string         `json:"id,omitempty"`
	Name      string         `json:"name"`
	Connector string         `json:"connector"`
	Config    map[string]any `json:"config"`
}

type StreamkapAPI

type StreamkapAPI interface {
	GetAccessToken(clientID, secret string) (*Token, error)
	SetToken(token *Token)

	//Source APIs
	CreateSource(ctx context.Context, reqPayload Source) (*Source, error)
	UpdateSource(ctx context.Context, sourceID string, reqPayload Source) (*Source, error)
	GetSource(ctx context.Context, sourceID string) (*Source, error)
	DeleteSource(ctx context.Context, sourceID string) error

	// Destination APIs
	CreateDestination(ctx context.Context, reqPayload Destination) (*Destination, error)
	UpdateDestination(ctx context.Context, destinationID string, reqPayload Destination) (*Destination, error)
	GetDestination(ctx context.Context, destinationID string) (*Destination, error)
	DeleteDestination(ctx context.Context, destinationID string) error

	// Pipeline APIs
	CreatePipeline(ctx context.Context, reqPayload Pipeline) (*Pipeline, error)
	UpdatePipeline(ctx context.Context, pipelineID string, reqPayload Pipeline) (*Pipeline, error)
	GetPipeline(ctx context.Context, pipelineID string) (*Pipeline, error)
	DeletePipeline(ctx context.Context, pipelineID string) error

	// Transform APIs
	GetTransform(ctx context.Context, transformID string) (*Transform, error)
}

func NewClient

func NewClient(cfg *Config) StreamkapAPI

type Token

type Token struct {
	AccessToken  string `json:"accessToken"`
	Expires      string `json:"expires"`
	ExpiresIn    int64  `json:"expiresIn"`
	RefreshToken string `json:"refreshToken"`
}

type Transform added in v1.0.2

type Transform struct {
	ID        string   `json:"id,omitempty"`
	Name      string   `json:"name"`
	StartTime *string  `json:"start_time"`
	TopicIDs  []string `json:"topic_ids"`
	Topics    []string `json:"topics"`
}

Jump to

Keyboard shortcuts

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