packageservice

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 13

Documentation

Overview

Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	PackageServiceName_ssms3       = "ssms3"
	PackageServiceName_birdwatcher = "birdwatcherUsingBirdwatcherArchive"
	PackageServiceName_document    = "birdwatcherUsingDocumentArchive"
)
View Source
const Latest = "latest"

Variables

This section is empty.

Functions

func IsLatest

func IsLatest(version string) bool

Types

type ByTiming

type ByTiming []*Trace

ByTiming implements sort.Interface for []*packageservice.Trace based on the Timing field.

func (ByTiming) Len

func (a ByTiming) Len() int

func (ByTiming) Less

func (a ByTiming) Less(i, j int) bool

func (ByTiming) Swap

func (a ByTiming) Swap(i, j int)

type ManifestCache

type ManifestCache interface {
	ReadManifest(packageArn string, packageVersion string) ([]byte, error)
	WriteManifest(packageArn string, packageVersion string, content []byte) error
	DeleteManifest(packageArn string, packageVersion string) error
	ReadManifestHash(packageArn string, documentVersion string) ([]byte, error)
	WriteManifestHash(packageArn string, documentVersion string, content []byte) error
}

ManifestCache caches manifests locally

type ManifestCacheMem

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

ManifestCacheMem stores cache in memory

func ManifestCacheMemNew

func ManifestCacheMemNew() *ManifestCacheMem

func (ManifestCacheMem) CacheKey

func (c ManifestCacheMem) CacheKey(packageArn string, packageVersion string) string

func (ManifestCacheMem) DeleteManifest

func (c ManifestCacheMem) DeleteManifest(packageArn string, packageVersion string) error

func (ManifestCacheMem) ReadManifest

func (c ManifestCacheMem) ReadManifest(packageArn string, packageVersion string) ([]byte, error)

func (ManifestCacheMem) ReadManifestHash

func (c ManifestCacheMem) ReadManifestHash(packageArn string, documentVersion string) ([]byte, error)

func (ManifestCacheMem) WriteManifest

func (c ManifestCacheMem) WriteManifest(packageArn string, packageVersion string, content []byte) error

func (ManifestCacheMem) WriteManifestHash

func (c ManifestCacheMem) WriteManifestHash(packageArn string, documentVersion string, content []byte) error

type PackageResult

type PackageResult struct {
	PackageName            string
	Version                string
	PreviousPackageVersion string
	Operation              string
	Timing                 int64
	Exitcode               int64
	Environment            map[string]string
	Trace                  []*Trace
}

PackageResult contains all data collected in one install/upgrade/uninstall and gets reported back to PackageService

type PackageService

type PackageService interface {
	PackageServiceName() string
	GetPackageArnAndVersion(packageName string, version string) (string, string)
	DownloadManifest(tracer trace.Tracer, packageName string, version string) (string, string, bool, error)
	DownloadArtifact(tracer trace.Tracer, packageName string, version string) (string, error)
	ReportResult(tracer trace.Tracer, result PackageResult) error
}

PackageService is used to determine the latest version and to obtain the local repository content for a given version.

type Trace

type Trace struct {
	Operation string
	Exitcode  int64
	Timing    int64
}

Trace contains one specific operation done for the agent install/upgrade/uninstall

func ConvertToPackageServiceTrace

func ConvertToPackageServiceTrace(traces []*trace.Trace) []*Trace

ConvertToPackageServiceTrace will return traces compatible with PackageService

Directories

Path Synopsis
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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