storage

package
v0.0.0-...-7d5e071 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package storage implements the backing store for build artifacts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Query(*dynamodb.QueryInput) (*dynamodb.QueryOutput, error)
}

DB models the subset of DynamoDb that we need.

type DefaultStorageService

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

DefaultStorageService is the default working storage service, which is based on Amazon S3 and DynamoDb.

func (DefaultStorageService) GetArtifacts

func (c DefaultStorageService) GetArtifacts(buildID string) ([]byte, error)

GetArtifacts returns the file manifest of artifacts tar file if the Accept: text/plain header is set. Otherwise returns the build artifacts as a gzipped tar file.

func (DefaultStorageService) GetBuildsByProject

func (c DefaultStorageService) GetBuildsByProject(project v1.Project, since uint64, limit uint64) ([]v1.Build, error)

GetBuildsByProject returns logical builds by team / project.

func (DefaultStorageService) GetConsoleLog

func (c DefaultStorageService) GetConsoleLog(buildID string) ([]byte, error)

GetConsoleLog returns console logs in plain text if the Accept: text/plain header is set. Otherwise returns the console log as a gzipped archive.

type S3

type S3 interface {
	GetObject(*s3.GetObjectInput) (*s3.GetObjectOutput, error)
}

S3 models the subset of all Amazon S3 that we need.

type Service

type Service interface {
	GetBuildsByProject(project v1.Project, sinceUnixTime uint64, limit uint64) ([]v1.Build, error)
	GetArtifacts(buildID string) ([]byte, error)
	GetConsoleLog(buildID string) ([]byte, error)
}

Service models the interaction between Decap and the persistent storage engine that stores build console logs, artifacts, and specific build metadata.

func NewAWS

func NewAWS(credential decapcreds.AWSCredential, logger *log.Logger) Service

NewAWS returns a StorageService implemented on top of Amazon S3 and DynamoDb.

Jump to

Keyboard shortcuts

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