packages

package
v2.45.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 24 Imported by: 5

Documentation

Index

Constants

View Source
const (
	OverwriteModeFailIfExists      = OverwriteMode("FailIfExists")
	OverwriteModeIgnoreIfExists    = OverwriteMode("IgnoreIfExists")
	OverwriteModeOverwriteExisting = OverwriteMode("OverwriteExisting")
)
View Source
const (
	UploadMethodStandard = UploadMethod("Standard")
	UploadMethodDelta    = UploadMethod("Delta")
)
View Source
const (
	DeltaBehaviourUploadedDeltaFile = DeltaBehaviour("Uploaded delta file")
	DeltaBehaviourNoPreviousFile    = DeltaBehaviour("Uploaded full file, no previous version available to delta")
	DeltaBehaviourNotEfficient      = DeltaBehaviour("Uploaded full file, delta file was not meaningfully smaller than full file")
)

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

func List added in v2.6.0

func List(client newclient.Client, spaceID string, filter string, limit int) (*resources.Resources[*Package], error)

List returns a list of packages from the server, in a standard Octopus paginated result structure. If you don't specify --limit the server will use a default limit (typically 30)

func ParsePackageIDAndVersion added in v2.45.0

func ParsePackageIDAndVersion(fileName string) (packageID string, version string, err error)

ParsePackageIDAndVersion ported from OctopusServer's PackageIdentity class See PackageIdentityParser in the C# Octopus Client SDK Note: Unlike in C#, fileName here includes the file extension

Types

type DeltaBehaviour added in v2.45.0

type DeltaBehaviour string

type DeltaUploadedPackageInfo added in v2.45.0

type DeltaUploadedPackageInfo struct {
	FileSize                 int64
	DeltaSize                int64
	RequestSignatureDuration time.Duration
	BuildDeltaDuration       time.Duration
	UploadDuration           time.Duration  // Time taken to upload the package (whether delta or full) depending on DeltaBehaviour
	DeltaBehaviour           DeltaBehaviour // A delta package upload can result in a standard upload if there is no previous version available, or if the delta process is not efficient. This tells you what happened
}

type DeploymentActionPackage

type DeploymentActionPackage struct {
	DeploymentAction string `json:"DeploymentAction,omitempty"`
	PackageReference string `json:"PackageReference,omitempty"`
}

type DeploymentActionSlugPackage added in v2.41.0

type DeploymentActionSlugPackage struct {
	DeploymentActionSlug string `json:"DeploymentActionSlug,omitempty"`
	PackageReference     string `json:"PackageReference,omitempty"`
}

type MultipartFileStreamingReader added in v2.6.0

type MultipartFileStreamingReader struct {
	IndirectWriter  *indirectWriter   // must initialize this before using the struct
	MultipartWriter *multipart.Writer // must initialize this before using the struct
	FileName        string            // must initialize this before using the struct
	FileReader      io.Reader         // must initialize this before using the struct
	// contains filtered or unexported fields
}

func NewMultipartFileStreamingReader added in v2.6.0

func NewMultipartFileStreamingReader(fileName string, fileReader io.Reader) *MultipartFileStreamingReader

func (*MultipartFileStreamingReader) Boundary added in v2.6.0

func (m *MultipartFileStreamingReader) Boundary() string

func (*MultipartFileStreamingReader) FormDataContentType added in v2.6.0

func (m *MultipartFileStreamingReader) FormDataContentType() string

func (*MultipartFileStreamingReader) Read added in v2.6.0

func (m *MultipartFileStreamingReader) Read(p []byte) (int, error)

Read is called by the go HTTP Client, when it wants more bytes to send over the network. internally we generate multipart header/boundary data, and write it, combined with the file contents.

func (*MultipartFileStreamingReader) SetBoundary added in v2.6.0

func (m *MultipartFileStreamingReader) SetBoundary(boundary string) error

type OctopusPackageMetadataService

type OctopusPackageMetadataService struct {
	services.Service
}

type OverwriteMode added in v2.6.0

type OverwriteMode string

type Package

type Package struct {
	Description      string                             `json:"Description,omitempty"`
	FeedID           string                             `json:"FeedId,omitempty"`
	FileExtension    string                             `json:"FileExtension,omitempty"`
	NuGetFeedID      string                             `json:"NuGetFeedId,omitempty"`
	NuGetPackageID   string                             `json:"NuGetPackageId,omitempty"`
	PackageID        string                             `json:"PackageId,omitempty"`
	BuildInformation *buildinformation.BuildInformation `json:"PackageVersionBuildInformation,omitempty"`
	Published        time.Time                          `json:"ReleaseNotes,omitempty"`
	Summary          string                             `json:"Summary,omitempty"`
	Title            string                             `json:"Title,omitempty"`
	Version          string                             `json:"Version,omitempty"`

	resources.Resource
}

func NewPackage

func NewPackage() *Package

type PackageDeltaSignatureQuery

type PackageDeltaSignatureQuery struct {
	PackageID string `uri:"packageId,omitempty" url:"packageId,omitempty"`
	Version   string `uri:"version,omitempty" url:"version,omitempty"`
}

type PackageDeltaUploadQuery

type PackageDeltaUploadQuery struct {
	BaseVersion   string `uri:"baseVersion,omitempty" url:"baseVersion,omitempty"`
	OverwriteMode string `uri:"overwriteMode,omitempty" url:"overwriteMode,omitempty"`
	PackageID     string `uri:"packageId,omitempty" url:"packageId,omitempty"`
	Replace       bool   `uri:"replace,omitempty" url:"replace,omitempty"`
}

type PackageDescription

type PackageDescription struct {
	Description   string `json:"Description,omitempty"`
	LatestVersion string `json:"LatestVersion,omitempty"`
	Name          string `json:"Name,omitempty"`

	resources.Resource
}

type PackageMetadataQuery

type PackageMetadataQuery struct {
	Filter        string `uri:"filter,omitempty" url:"filter,omitempty"`
	Latest        string `uri:"latest,omitempty" url:"latest,omitempty"`
	OverwriteMode string `uri:"overwriteMode,omitempty" url:"overwriteMode,omitempty"`
	Replace       bool   `uri:"replace,omitempty" url:"replace,omitempty"`
	Skip          int    `uri:"skip,omitempty" url:"skip,omitempty"`
	Take          int    `uri:"take,omitempty" url:"take,omitempty"`
}

type PackageMetadataService

type PackageMetadataService struct {
	services.Service
}

func NewPackageMetadataService

func NewPackageMetadataService(sling *sling.Sling, uriTemplate string) *PackageMetadataService

type PackageNote

type PackageNote struct {
	FeedID    string              `json:"FeedId,omitempty"`
	Notes     *PackageNotesResult `json:"Notes,omitempty"`
	PackageID string              `json:"PackageId,omitempty"`
	Version   string              `json:"Version,omitempty"`
}

func NewPackageNote

func NewPackageNote() *PackageNote

type PackageNotesListQuery

type PackageNotesListQuery struct {
	PackageIDs []string `uri:"packageIds,omitempty" url:"packageIds,omitempty"`
}

type PackageNotesResult

type PackageNotesResult struct {
	DisplayMessage string `json:"DisplayMessage,omitempty"`
	FailureReason  string `json:"FailureReason,omitempty"`
	Notes          string `json:"Notes,omitempty"`
	Succeeded      bool   `json:"Succeeded"`
}

func NewPackageNotesResult

func NewPackageNotesResult() *PackageNotesResult

type PackageReference

type PackageReference struct {
	AcquisitionLocation string            `json:"AcquisitionLocation"` // This can be an expression
	FeedID              string            `json:"FeedId"`
	ID                  string            `json:"Id,omitempty"`
	Name                string            `json:"Name,omitempty"`
	PackageID           string            `json:"PackageId,omitempty"`
	Properties          map[string]string `json:"Properties"`
}

type PackageService

type PackageService struct {
	services.CanDeleteService
	// contains filtered or unexported fields
}

func NewPackageService

func NewPackageService(sling *sling.Sling, uriTemplate string, deltaSignaturePath string, deltaUploadPath string, notesListPath string, bulkPath string, uploadPath string) *PackageService

func (*PackageService) GetAll

func (s *PackageService) GetAll() ([]*Package, error)

GetAll returns all packages. If none can be found or an error occurs, it returns an empty collection.

func (*PackageService) GetByID

func (s *PackageService) GetByID(id string) (*Package, error)

GetByID returns the package that matches the input ID. If one cannot be found, it returns nil and an error.

func (*PackageService) Update

func (s *PackageService) Update(octopusPackage *Package) (*Package, error)

Update modifies a package based on the one provided as input.

type PackageSignatureResponse added in v2.45.0

type PackageSignatureResponse struct {
	Signature   string `json:"Signature" validate:"required"` // base64 encoded binary
	BaseVersion string `json:"BaseVersion" validate:"required"`
}

type PackageUploadQuery

type PackageUploadQuery struct {
	Replace       bool   `uri:"replace,omitempty" url:"replace,omitempty"`
	OverwriteMode string `uri:"overwriteMode,omitempty" url:"overwriteMode,omitempty"`
}

type PackageUploadResponse added in v2.6.0

type PackageUploadResponse struct {
	PackageSizeBytes int
	Hash             string
	NuGetPackageId   string
	PackageId        string
	NuGetFeedId      string
	FeedId           string
	Title            string
	Summary          string
	Version          string
	Description      string
	Published        *time.Time
	ReleaseNotes     string
	FileExtension    string

	resources.Resource
}

PackageUploadResponse represents the data returned by the Octopus server after uploading a package

func Upload added in v2.6.0

func Upload(client newclient.Client, spaceID string, fileName string, reader io.Reader, overwriteMode OverwriteMode) (*PackageUploadResponse, bool, error)

Upload uploads a package to the octopus server's builtin package feed. Parameters: - client: The API client reference - spaceID: ID of the octopus space to work within - fileName: The string which we tell the server to use for the file name (may not necessarily be an actual filename on disk) - reader: io.Reader which provides the binary file data to upload - overwriteMode: Instructs the server what to do in the case that the package already exists.

Return values: - PackageUploadResponse: The server's response to the upload request - bool: True if the server created a new file, false if it ignored an existing file - error: Any error that occurred during the upload process

type PackageUploadResponseV2 added in v2.45.0

type PackageUploadResponseV2 struct {
	CreatedNewFile bool
	UploadMethod   UploadMethod

	// Holds information about the uploaded package.
	// If UploadMethod is UploadMethodStandard, will be nil
	// If UploadMethod is UploadMethodDelta, will be a valid struct
	UploadInfo *DeltaUploadedPackageInfo

	PackageUploadResponse
}

func UploadV2 added in v2.45.0

func UploadV2(client newclient.Client, spaceID string, fileName string, reader io.ReadSeeker, overwriteMode OverwriteMode, useDeltaCompression bool) (*PackageUploadResponseV2, error)

type PackageVersion

type PackageVersion struct {
	FeedID       string    `json:"FeedId,omitempty"`
	PackageID    string    `json:"PackageId,omitempty"`
	Published    time.Time `json:"Published,omitempty"`
	ReleaseNotes string    `json:"ReleaseNotes,omitempty"`
	SizeBytes    int64     `json:"SizeBytes,omitempty"`
	Title        string    `json:"Title,omitempty"`
	Version      string    `json:"Version,omitempty"`

	resources.Resource
}

func NewPackageVersion

func NewPackageVersion() *PackageVersion

type PackagesBulkQuery

type PackagesBulkQuery struct {
	IDs []string `uri:"ids,omitempty" url:"ids,omitempty"`
}

type PackagesQuery

type PackagesQuery struct {
	Filter         string `uri:"filter,omitempty" url:"filter,omitempty"`
	IncludeNotes   bool   `uri:"includeNotes,omitempty" url:"includeNotes,omitempty"`
	Latest         string `uri:"latest,omitempty" url:"latest,omitempty"`
	NuGetPackageID string `uri:"nuGetPackageId,omitempty" url:"nuGetPackageId,omitempty"`
	Skip           int    `uri:"skip,omitempty" url:"skip,omitempty"`
	Take           int    `uri:"take,omitempty" url:"take,omitempty"`
}

type SelectedPackage

type SelectedPackage struct {
	ActionName           string `json:"ActionName,omitempty"`
	PackageReferenceName string `json:"PackageReferenceName,omitempty"`
	StepName             string `json:"StepName,omitempty"`
	Version              string `json:"Version,omitempty"`
}

type UploadMethod added in v2.45.0

type UploadMethod string

type UploadedPackageInfo added in v2.45.0

type UploadedPackageInfo interface {
}

Jump to

Keyboard shortcuts

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