glue

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classifier

type Classifier struct {
	Name           string
	Type           string // GROK, XML, JSON, CSV
	GrokPattern    string
	CustomPatterns string
	CreateTime     time.Time
	LastUpdated    time.Time
}

Classifier represents a Glue classifier.

type Column

type Column struct {
	Name    string
	Type    string
	Comment string
}

Column represents a table column.

type Connection

type Connection struct {
	Name                           string
	Description                    string
	ConnectionType                 string
	ConnectionProperties           map[string]string
	PhysicalConnectionRequirements *PhysicalConnectionRequirements
	CreateTime                     time.Time
}

Connection represents a Glue connection.

type Crawler

type Crawler struct {
	Name         string
	Role         string
	DatabaseName string
	Description  string
	Targets      CrawlerTargets
	Schedule     string
	State        string
	Lifecycle    *lifecycle.Machine
	CreateTime   time.Time
	LastUpdated  time.Time
	Tags         map[string]string
	LastCrawl    *LastCrawlInfo
}

Crawler represents a Glue crawler.

type CrawlerTargets

type CrawlerTargets struct {
	S3Targets []S3Target
}

CrawlerTargets holds crawler target configuration.

type Database

type Database struct {
	Name        string
	Description string
	LocationURI string
	CreateTime  time.Time
	Parameters  map[string]string
}

Database represents a Glue catalog database.

type GlueService

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

GlueService is the cloudmock implementation of the AWS Glue API.

func New

func New(accountID, region string) *GlueService

New returns a new GlueService for the given AWS account ID and region.

func (*GlueService) Actions

func (s *GlueService) Actions() []service.Action

Actions returns the list of Glue API actions supported by this service.

func (*GlueService) HandleRequest

func (s *GlueService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Glue request to the appropriate handler.

func (*GlueService) HealthCheck

func (s *GlueService) HealthCheck() error

HealthCheck always returns nil (no external dependencies).

func (*GlueService) Name

func (s *GlueService) Name() string

Name returns the AWS service name used for routing.

func (*GlueService) SetLocator

func (s *GlueService) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service lookups (e.g., S3 for crawlers).

type Job

type Job struct {
	Name            string
	Role            string
	Command         JobCommand
	Description     string
	MaxRetries      int
	MaxCapacity     float64
	GlueVersion     string
	NumberOfWorkers int
	WorkerType      string
	CreateTime      time.Time
	Tags            map[string]string
}

Job represents a Glue ETL job.

type JobCommand

type JobCommand struct {
	Name           string
	ScriptLocation string
	PythonVersion  string
}

JobCommand holds the script location and language.

type JobRun

type JobRun struct {
	ID            string
	JobName       string
	State         string
	StartedOn     time.Time
	CompletedOn   *time.Time
	Lifecycle     *lifecycle.Machine
	ErrorMessage  string
	Attempt       int
	ExecutionTime int
}

JobRun represents a single execution of a job.

type LastCrawlInfo

type LastCrawlInfo struct {
	Status        string // SUCCEEDED, FAILED
	ErrorMessage  string
	LogGroup      string
	LogStream     string
	MessagePrefix string
	StartTime     time.Time
	TablesCreated int
	TablesUpdated int
}

LastCrawlInfo holds metadata about the most recent crawler run.

type Partition

type Partition struct {
	DatabaseName string
	TableName    string
	Values       []string
	StorageDesc  StorageDescriptor
	Parameters   map[string]string
	CreateTime   time.Time
}

Partition represents a table partition.

type PhysicalConnectionRequirements

type PhysicalConnectionRequirements struct {
	SubnetID            string
	SecurityGroupIDList []string
	AvailabilityZone    string
}

PhysicalConnectionRequirements holds network config.

type S3Target

type S3Target struct {
	Path       string
	Exclusions []string
}

S3Target represents an S3 path target for a crawler.

type ServiceLocator

type ServiceLocator interface {
	Lookup(name string) (service.Service, error)
}

ServiceLocator resolves other services by name.

type StorageDescriptor

type StorageDescriptor struct {
	Location     string
	InputFormat  string
	OutputFormat string
	Columns      []Column
}

StorageDescriptor holds storage info for a table.

type Store

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

Store manages all Glue resources in memory.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates a new Glue store.

func (*Store) BatchCreatePartitions

func (s *Store) BatchCreatePartitions(dbName, tableName string, partitions []*Partition) []*Partition

func (*Store) CreateClassifier

func (s *Store) CreateClassifier(classifier *Classifier) bool

func (*Store) CreateConnection

func (s *Store) CreateConnection(conn *Connection) bool

func (*Store) CreateCrawler

func (s *Store) CreateCrawler(name, role, dbName, description, schedule string, targets CrawlerTargets, tags map[string]string) (*Crawler, bool)

func (*Store) CreateDatabase

func (s *Store) CreateDatabase(name, description, locationURI string) (*Database, bool)

func (*Store) CreateJob

func (s *Store) CreateJob(job *Job) bool

func (*Store) CreatePartition

func (s *Store) CreatePartition(dbName, tableName string, partition *Partition) bool

func (*Store) CreateTable

func (s *Store) CreateTable(dbName string, table *Table) bool

func (*Store) CreateTrigger

func (s *Store) CreateTrigger(trigger *Trigger) bool

func (*Store) DeleteClassifier

func (s *Store) DeleteClassifier(name string) bool

func (*Store) DeleteConnection

func (s *Store) DeleteConnection(name string) bool

func (*Store) DeleteCrawler

func (s *Store) DeleteCrawler(name string) bool

func (*Store) DeleteDatabase

func (s *Store) DeleteDatabase(name string) bool

func (*Store) DeleteJob

func (s *Store) DeleteJob(name string) bool

func (*Store) DeletePartition

func (s *Store) DeletePartition(dbName, tableName string, values []string) bool

func (*Store) DeleteTable

func (s *Store) DeleteTable(dbName, tableName string) bool

func (*Store) DeleteTrigger

func (s *Store) DeleteTrigger(name string) bool

func (*Store) GetClassifier

func (s *Store) GetClassifier(name string) (*Classifier, bool)

func (*Store) GetConnection

func (s *Store) GetConnection(name string) (*Connection, bool)

func (*Store) GetCrawler

func (s *Store) GetCrawler(name string) (*Crawler, bool)

func (*Store) GetDatabase

func (s *Store) GetDatabase(name string) (*Database, bool)

func (*Store) GetJob

func (s *Store) GetJob(name string) (*Job, bool)

func (*Store) GetJobRun

func (s *Store) GetJobRun(jobName, runID string) (*JobRun, bool)

func (*Store) GetPartitions

func (s *Store) GetPartitions(dbName, tableName string) []*Partition

func (*Store) GetTable

func (s *Store) GetTable(dbName, tableName string) (*Table, bool)

func (*Store) GetTags

func (s *Store) GetTags(arn string) map[string]string

func (*Store) GetTrigger

func (s *Store) GetTrigger(name string) (*Trigger, bool)

func (*Store) ListClassifiers

func (s *Store) ListClassifiers() []*Classifier

func (*Store) ListConnections

func (s *Store) ListConnections() []*Connection

func (*Store) ListCrawlers

func (s *Store) ListCrawlers() []*Crawler

func (*Store) ListDatabases

func (s *Store) ListDatabases() []*Database

func (*Store) ListJobRuns

func (s *Store) ListJobRuns(jobName string) []*JobRun

func (*Store) ListJobs

func (s *Store) ListJobs() []*Job

func (*Store) ListTables

func (s *Store) ListTables(dbName string) []*Table

func (*Store) ListTriggers

func (s *Store) ListTriggers() []*Trigger

func (*Store) SetLocator

func (s *Store) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service lookups.

func (*Store) StartCrawler

func (s *Store) StartCrawler(name string) bool

func (*Store) StartJobRun

func (s *Store) StartJobRun(jobName string) (*JobRun, bool)

func (*Store) StopCrawler

func (s *Store) StopCrawler(name string) bool

func (*Store) StopJobRun

func (s *Store) StopJobRun(jobName, runID string) bool

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string)

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string)

func (*Store) UpdateCrawler

func (s *Store) UpdateCrawler(name, role, description, schedule string) bool

UpdateCrawler updates crawler settings.

func (*Store) UpdateDatabase

func (s *Store) UpdateDatabase(name, description, locationURI string) bool

UpdateDatabase updates a database's description and location.

func (*Store) UpdateJob

func (s *Store) UpdateJob(name, role, description string, maxRetries int) bool

UpdateJob updates job settings.

func (*Store) UpdateTable

func (s *Store) UpdateTable(dbName string, table *Table) bool

func (*Store) UpdateTrigger

func (s *Store) UpdateTrigger(name, description, schedule string) bool

type Table

type Table struct {
	Name         string
	DatabaseName string
	Description  string
	StorageDesc  StorageDescriptor
	Parameters   map[string]string
	CreateTime   time.Time
	UpdateTime   time.Time
}

Table represents a Glue catalog table.

type Trigger

type Trigger struct {
	Name        string
	Type        string // SCHEDULED, CONDITIONAL, ON_DEMAND
	State       string // CREATED, ACTIVATED, DEACTIVATED
	Description string
	Schedule    string
	Actions     []TriggerAction
	CreateTime  time.Time
	Tags        map[string]string
}

Trigger represents a Glue trigger.

type TriggerAction

type TriggerAction struct {
	JobName   string
	Arguments map[string]string
}

TriggerAction describes what the trigger does.

Jump to

Keyboard shortcuts

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