Documentation
¶
Index ¶
- Constants
- Variables
- func GetSha1FromReader(reader io.ReadCloser) (string, error)
- func HasExtFile(path string, extensions ...string) bool
- func IsTarFile(path string) bool
- func IsTarGzFile(path string) bool
- func IsZipFile(path string) bool
- type ApplicationBitsRepository
- type BitsManager
- type CloudControllerApplicationBitsRepository
- func (repo CloudControllerApplicationBitsRepository) CopyBits(origAppGuid string, newAppGuid string) error
- func (repo CloudControllerApplicationBitsRepository) GetApplicationSha1(appGUID string) (string, error)
- func (repo CloudControllerApplicationBitsRepository) IsDiff(appGUID string, currentSha1 string) (bool, string, error)
- func (repo CloudControllerApplicationBitsRepository) UploadBits(appGUID string, zipFile io.ReadCloser, fileSize int64) error
- func (repo CloudControllerApplicationBitsRepository) UploadBitsTmp(appGUID string, zipFile io.ReadCloser, fileSize int64) (apiErr error)
- type CloudControllerBitsManager
- func (m CloudControllerBitsManager) CopyBits(origAppGuid string, newAppGuid string) error
- func (m CloudControllerBitsManager) GetSha1(path string) (string, error)
- func (m CloudControllerBitsManager) IsDiff(path string, currentSha1 string) (bool, string, error)
- func (m CloudControllerBitsManager) Upload(appGuid string, path string) error
- type FileHandler
- type GitHandler
- type GitUtils
- type Handler
- type HttpHandler
- type Job
- type LocalHandler
Constants ¶
View Source
const ( CHUNK_FOR_SHA1 = 5 * 1024 APP_FILENAME = "application.zip" )
View Source
const (
DefaultAppUploadBitsTimeout = 15 * time.Minute
)
Variables ¶
View Source
var GZIP_FILE_EXT []string = []string{
".gz",
".gzip",
}
View Source
var TARGZ_FILE_EXT []string = []string{
".tgz",
}
View Source
var TAR_FILE_EXT []string = []string{
".tar",
}
View Source
var ZIP_FILE_EXT []string = []string{
".zip",
".jar",
".war",
}
Functions ¶
func GetSha1FromReader ¶
func GetSha1FromReader(reader io.ReadCloser) (string, error)
func HasExtFile ¶ added in v0.9.0
func IsTarGzFile ¶ added in v0.9.0
Types ¶
type BitsManager ¶
type CloudControllerApplicationBitsRepository ¶
type CloudControllerApplicationBitsRepository struct {
// contains filtered or unexported fields
}
func NewCloudControllerApplicationBitsRepository ¶
func NewCloudControllerApplicationBitsRepository(config coreconfig.Reader, gateway net.Gateway) (repo CloudControllerApplicationBitsRepository)
func (CloudControllerApplicationBitsRepository) CopyBits ¶
func (repo CloudControllerApplicationBitsRepository) CopyBits(origAppGuid string, newAppGuid string) error
func (CloudControllerApplicationBitsRepository) GetApplicationSha1 ¶
func (repo CloudControllerApplicationBitsRepository) GetApplicationSha1(appGUID string) (string, error)
func (CloudControllerApplicationBitsRepository) UploadBits ¶
func (repo CloudControllerApplicationBitsRepository) UploadBits(appGUID string, zipFile io.ReadCloser, fileSize int64) error
func (CloudControllerApplicationBitsRepository) UploadBitsTmp ¶
func (repo CloudControllerApplicationBitsRepository) UploadBitsTmp(appGUID string, zipFile io.ReadCloser, fileSize int64) (apiErr error)
/// Old way to send bits, now do it as a stream
type CloudControllerBitsManager ¶
type CloudControllerBitsManager struct {
// contains filtered or unexported fields
}
func NewCloudControllerBitsManager ¶
func NewCloudControllerBitsManager(appBitsRepo ApplicationBitsRepository, handlers []Handler) (manager CloudControllerBitsManager)
func (CloudControllerBitsManager) CopyBits ¶
func (m CloudControllerBitsManager) CopyBits(origAppGuid string, newAppGuid string) error
func (CloudControllerBitsManager) GetSha1 ¶
func (m CloudControllerBitsManager) GetSha1(path string) (string, error)
type FileHandler ¶
type FileHandler struct {
ZipFile io.ReadCloser
Size int64
Clean func() error
}
type GitHandler ¶ added in v0.9.0
type GitHandler struct {
}
func NewGitHandler ¶ added in v0.9.0
func NewGitHandler(skipInsecureSSL bool) *GitHandler
func (GitHandler) Detect ¶ added in v0.9.0
func (h GitHandler) Detect(path string) bool
func (GitHandler) GetSha1File ¶ added in v0.9.0
func (h GitHandler) GetSha1File(path string) (string, error)
func (GitHandler) GetZipFile ¶ added in v0.9.0
func (h GitHandler) GetZipFile(path string) (FileHandler, error)
type GitUtils ¶ added in v0.9.0
type GitUtils struct {
Folder string
Url string
RefName string
AuthMethod transport.AuthMethod
}
func (GitUtils) GetCommitSha1 ¶ added in v0.9.0
type HttpHandler ¶
type HttpHandler struct {
SkipInsecureSSL bool
}
func NewHttpHandler ¶ added in v0.9.0
func NewHttpHandler(skipInsecureSSL bool) *HttpHandler
func (HttpHandler) Detect ¶
func (h HttpHandler) Detect(path string) bool
func (HttpHandler) GetSha1File ¶
func (h HttpHandler) GetSha1File(path string) (string, error)
func (HttpHandler) GetZipFile ¶
func (h HttpHandler) GetZipFile(path string) (FileHandler, error)
type Job ¶
type Job struct {
Metadata struct {
GUID string `json:"guid"`
CreatedAt time.Time `json:"created_at"`
URL string `json:"url"`
} `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Status string `json:"status"`
Error string `json:"error"`
ErrorDetails struct {
Code int `json:"code"`
Description string `json:"description"`
ErrorCode string `json:"error_code"`
} `json:"error_details"`
} `json:"entity"`
}
type LocalHandler ¶
type LocalHandler struct {
}
func NewLocalHandler ¶ added in v0.9.0
func NewLocalHandler() *LocalHandler
func (LocalHandler) Detect ¶
func (h LocalHandler) Detect(path string) bool
func (LocalHandler) GetSha1File ¶
func (h LocalHandler) GetSha1File(path string) (string, error)
func (LocalHandler) GetZipFile ¶
func (h LocalHandler) GetZipFile(path string) (FileHandler, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.