upload

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextEnvelope

type ContextEnvelope struct {
	Metadata ContextMetadata `json:"metadata"`
	Payload  json.RawMessage `json:"payload"`
}

ContextEnvelope wraps the uploaded payload with metadata.

type ContextMetadata

type ContextMetadata struct {
	ContextType string `json:"contextType"`
	Repository  string `json:"repository"`
	Branch      string `json:"branch,omitempty"`
	Environment string `json:"environment,omitempty"`
	Name        string `json:"name"`
	PRNumber    int    `json:"prNumber,omitempty"`
	FromPR      int    `json:"fromPR,omitempty"`
	CommitSHA   string `json:"commitSha,omitempty"`
	UploadedAt  string `json:"uploadedAt"`
	CLIVersion  string `json:"cliVersion"`
}

ContextMetadata contains metadata about the context upload.

type S3Uploader

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

S3Uploader uploads context data to S3 using temporary credentials.

func NewS3Uploader

func NewS3Uploader(accessKeyID, secretAccessKey, sessionToken, region, bucket, keyPrefix, kmsKeyARN string) *S3Uploader

NewS3Uploader creates a new S3 uploader with the given temporary credentials.

func (*S3Uploader) Upload

func (u *S3Uploader) Upload(ctx context.Context, filePath string, metadata ContextMetadata) error

Upload reads the file, wraps it in an envelope, and uploads to S3 as latest.json and history/{timestamp}.json.

Jump to

Keyboard shortcuts

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