Documentation ¶
Overview ¶
Copyright 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/
or in the "license" file accompanying this file. This file 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.
Copyright 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/
or in the "license" file accompanying this file. This file 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 ¶
- Variables
- func CompleteJsonUnmarshal(b []byte, iface interface{}) error
- func DefaultIfBlank(str string, default_value string) string
- func ExtractVersion(input string) string
- func GetCPUFlags(cpuInfo *CPUInfo) map[string]bool
- func IsAWSErrorCodeEqual(err error, code string) bool
- func JsonKeys(b []byte) ([]string, error)
- func MapToTags(tagsMap map[string]string) []*ecs.Tag
- func NewJitteredTicker(ctx context.Context, start, end time.Duration) <-chan time.Time
- func ParseBool(str string, default_ bool) bool
- func ParseRepositoryTag(repoTag string) (repository string, tag string)
- func RandHex() string
- func SearchStrInDir(dir, filePrefix, content string) error
- func SignHTTPRequest(req *http.Request, region, service string, creds *credentials.Credentials, ...) error
- func SlicesDeepEqual(slice1, slice2 interface{}) bool
- func StrSliceContains(strs []string, s string) bool
- func StrSliceEqual(s1, s2 []string) bool
- func Strptr(s string) *string
- func Uint16SliceToStringSlice(slice []uint16) []*string
- func ZeroOrNil(obj interface{}) bool
- type CPUInfo
- type ChanSemaphore
- type LicenseProvider
- type Processor
- type Semaphore
- type UUIDProvider
- type Version
Constants ¶
This section is empty.
Variables ¶
var (
OpenFile = os.Open
)
Functions ¶
func CompleteJsonUnmarshal ¶
CompleteJsonUnmarshal determines if a given struct has members corresponding to every key of a json object (passed as the json string). By default, Go ignores fields in an object which have no corresponding struct member and this can be used to determine if this ignoring has occurred Errors will result in "false" as a return value
func DefaultIfBlank ¶
func ExtractVersion ¶ added in v1.14.0
ExtractVersion extracts a matching version from the version number string
func GetCPUFlags ¶ added in v1.30.0
GetCPUFlags merges all processors' flags and return as a map. Returning map makes it easy to check whether a flag exists or not.
func IsAWSErrorCodeEqual ¶ added in v1.18.0
IsAWSErrorCodeEqual returns true if the err implements Error interface of awserr and it has the same error code as the passed in error code.
func JsonKeys ¶
JsonKeys takes an arbitrary byte array representing a json stringified object and returns all the keys of that object.
func NewJitteredTicker ¶ added in v1.18.0
NewJitteredTicker works like a time.Ticker except with randomly distributed ticks between start and end duration.
func ParseRepositoryTag ¶ added in v1.24.0
ParseRepositoryTag mimics the go-dockerclient's ParseReposirotyData. The only difference is that it doesn't ignore the sha when present.
func SearchStrInDir ¶ added in v1.32.1
SearchStrInDir searches the files in directory for specific content
func SignHTTPRequest ¶ added in v1.3.1
func SignHTTPRequest(req *http.Request, region, service string, creds *credentials.Credentials, body io.ReadSeeker) error
SignHTTPRequest signs an http.Request struct with authv4 using the given region, service, and credentials.
func SlicesDeepEqual ¶
func SlicesDeepEqual(slice1, slice2 interface{}) bool
SlicesDeepEqual checks if slice1 and slice2 are equal, disregarding order.
func StrSliceContains ¶ added in v1.34.0
func StrSliceEqual ¶
func Uint16SliceToStringSlice ¶
Uint16SliceToStringSlice converts a slice of type uint16 to a slice of type *string. It uses strconv.Itoa on each element
Types ¶
type CPUInfo ¶ added in v1.30.0
type CPUInfo struct {
Processors []Processor `json:"processors"`
}
func ReadCPUInfo ¶ added in v1.30.0
type ChanSemaphore ¶
type ChanSemaphore struct { Count int // Public for introspection; should not be written to // contains filtered or unexported fields }
Implements semaphore
func (*ChanSemaphore) Post ¶
func (s *ChanSemaphore) Post()
func (*ChanSemaphore) Wait ¶
func (s *ChanSemaphore) Wait()
type LicenseProvider ¶ added in v1.5.0
func NewLicenseProvider ¶ added in v1.5.0
func NewLicenseProvider() LicenseProvider
type UUIDProvider ¶ added in v1.21.0
type UUIDProvider interface {
New() string
}
UUIDProvider wraps 'uuid' methods for testing
func NewDynamicUUIDProvider ¶ added in v1.21.0
func NewDynamicUUIDProvider() UUIDProvider
NewDynamicUUIDProvider returns a new dynamicUUIDProvider
func NewStaticUUIDProvider ¶ added in v1.21.0
func NewStaticUUIDProvider(staticID string) UUIDProvider
NewStaticUUIDProvider returns a new staticUUIDProvider
type Version ¶ added in v1.14.0
type Version string
func (Version) Matches ¶ added in v1.14.0
Matches returns whether or not a version matches a given selector. The selector can be any of the following:
* x.y.z -- Matches a version exactly the same as the selector version * >=x.y.z -- Matches a version greater than or equal to the selector version * >x.y.z -- Matches a version greater than the selector version * <=x.y.z -- Matches a version less than or equal to the selector version * <x.y.z -- Matches a version less than the selector version * x.y.z,a.b.c -- Matches if the version matches either of the two selector versions
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mock_bufiowrapper is a generated GoMock package.
|
Package mock_bufiowrapper is a generated GoMock package. |
Package cipher provides customized cipher configuration for agent client
|
Package cipher provides customized cipher configuration for agent client |
mocks
Package mock_ioutilwrapper is a generated GoMock package.
|
Package mock_ioutilwrapper is a generated GoMock package. |
mocks
Package mock_mobypkgwrapper is a generated GoMock package.
|
Package mock_mobypkgwrapper is a generated GoMock package. |
Package mock_utils is a generated GoMock package.
|
Package mock_utils is a generated GoMock package. |
mock
Package mock_retry is a generated GoMock package.
|
Package mock_retry is a generated GoMock package. |
Package sync is an analogue to the stdlib sync package.
|
Package sync is an analogue to the stdlib sync package. |
Package ttime implements a testable alternative to the Go "time" package.
|
Package ttime implements a testable alternative to the Go "time" package. |
mocks
Package mock_ttime is a generated GoMock package.
|
Package mock_ttime is a generated GoMock package. |