Documentation ¶
Overview ¶
* This file is part of AMS SDK * Copyright 2021 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the Lesser GNU General Public License version 3, as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, SATISFACTORY * QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public * License for more details. * * You should have received a copy of the Lesser GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func IgnoreErrNotFound(err error) error
- func IsErrInvalidArgument(err error) bool
- func IsErrNotAllowed(err error) bool
- func IsErrNotFound(err error) bool
- type ErrAborted
- type ErrAlreadyExists
- type ErrDontMatch
- type ErrFailed
- type ErrInProgress
- type ErrInvalidArgument
- type ErrInvalidFormat
- type ErrInvalidLength
- type ErrMalformed
- type ErrNotAllowed
- type ErrNotChanged
- type ErrNotExecutable
- type ErrNotFound
- type ErrNotSupported
- type ErrRequired
- type ErrTimeout
- type ErrUnknown
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAlreadyRunning is returned when an object is already running when it was started again ErrAlreadyRunning = fmt.Errorf("Already running") )
Functions ¶
func IgnoreErrNotFound ¶
IgnoreErrNotFound returns nil when the provided error is of type ErrNotFound and otherwise the given error
func IsErrInvalidArgument ¶
IsErrInvalidArgument checks if the given error is of type ErrInvalidArgument
func IsErrNotAllowed ¶
IsErrNotAllowed checks if the given error is of type ErrNotAllowed
func IsErrNotFound ¶
IsErrNotFound checks if the given error is of type ErrNotFound
Types ¶
type ErrAborted ¶
type ErrAborted struct {
// contains filtered or unexported fields
}
ErrAborted describes an error when an operation was aborted
func NewErrAborted ¶
func NewErrAborted(what string) ErrAborted
NewErrAborted returns a new ErrAborted struct
type ErrAlreadyExists ¶
type ErrAlreadyExists struct {
// contains filtered or unexported fields
}
ErrAlreadyExists describes an error when a resource already exists
func NewErrAlreadyExists ¶
func NewErrAlreadyExists(what string) ErrAlreadyExists
NewErrAlreadyExists returns a new ErrAlreadyExists struct
func (ErrAlreadyExists) Error ¶
func (e ErrAlreadyExists) Error() string
Error returns the error string
type ErrDontMatch ¶
type ErrDontMatch struct {
// contains filtered or unexported fields
}
ErrDontMatch error struct for a parameter whose value does not match the expected
func NewErrDontMatch ¶
func NewErrDontMatch(what, got, expected string) ErrDontMatch
NewErrDontMatch returns a new ErrDontMatch struct
type ErrFailed ¶
type ErrFailed struct {
// contains filtered or unexported fields
}
ErrFailed describes an error when an operation has failed
func NewErrFailed ¶
NewErrFailed returns a new ErrFailed struct
type ErrInProgress ¶
type ErrInProgress struct {
// contains filtered or unexported fields
}
ErrInProgress describes an error when an operation is already in progress
func NewErrInProgress ¶
func NewErrInProgress(what string) ErrInProgress
NewErrInProgress returns a new ErrInProgress struct
type ErrInvalidArgument ¶
type ErrInvalidArgument struct {
// contains filtered or unexported fields
}
ErrInvalidArgument describes the error when an invalid argument was given
func NewInvalidArgument ¶
func NewInvalidArgument(what string) ErrInvalidArgument
NewInvalidArgument returns a new ErrInvalidArgument struct
func (ErrInvalidArgument) Error ¶
func (e ErrInvalidArgument) Error() string
Error returns the error string
type ErrInvalidFormat ¶
type ErrInvalidFormat struct {
// contains filtered or unexported fields
}
ErrInvalidFormat describes the error when an invalid format for an argument was given
func NewErrInvalidFormat ¶
func NewErrInvalidFormat(what string) ErrInvalidFormat
NewErrInvalidFormat returns a new ErrInvalidFormat struct
func (ErrInvalidFormat) Error ¶
func (e ErrInvalidFormat) Error() string
Error returns the error string
type ErrInvalidLength ¶
type ErrInvalidLength struct {
// contains filtered or unexported fields
}
ErrInvalidLength describes the error when an argument has an invalid length
func NewErrInvalidLength ¶
func NewErrInvalidLength(what string) ErrInvalidLength
NewErrInvalidLength returns a new ErrInvalidLength struct
func (ErrInvalidLength) Error ¶
func (e ErrInvalidLength) Error() string
Error returns the error string
type ErrMalformed ¶
type ErrMalformed struct {
// contains filtered or unexported fields
}
ErrMalformed describes the error when a malformed content was given
func NewErrMalformed ¶
func NewErrMalformed(what string) ErrMalformed
NewErrMalformed returns a new ErrMalformed struct
type ErrNotAllowed ¶
type ErrNotAllowed struct {
// contains filtered or unexported fields
}
ErrNotAllowed error struct when an operation is not allowed
func NewErrNotAllowed ¶
func NewErrNotAllowed(what string) ErrNotAllowed
NewErrNotAllowed returns a new ErrNotAllowed struct
type ErrNotChanged ¶
type ErrNotChanged struct {
// contains filtered or unexported fields
}
ErrNotChanged describes an error when a value has changed
func NewErrNotChanged ¶
func NewErrNotChanged(what string) ErrNotChanged
NewErrNotChanged returns a new ErrNotChanged struct
type ErrNotExecutable ¶
type ErrNotExecutable struct {
// contains filtered or unexported fields
}
ErrNotExecutable represents a non executable file permission error structure
func NewErrNotExecutable ¶
func NewErrNotExecutable(what string) ErrNotExecutable
NewErrNotExecutable returns a new ErrNotExecutable struct
func (ErrNotExecutable) Error ¶
func (e ErrNotExecutable) Error() string
Error returns the error string
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
ErrNotFound error struct for a not existing resource
func NewErrNotFound ¶
func NewErrNotFound(what string) ErrNotFound
NewErrNotFound returns a new ErrNotFound struct
type ErrNotSupported ¶
type ErrNotSupported struct {
// contains filtered or unexported fields
}
ErrNotSupported error struct for a not supported functionality
func NewErrNotSupported ¶
func NewErrNotSupported(what string) ErrNotSupported
NewErrNotSupported returns a new ErrNotSupported struct
func (ErrNotSupported) Error ¶
func (e ErrNotSupported) Error() string
Error returns the error string
type ErrRequired ¶
type ErrRequired struct {
// contains filtered or unexported fields
}
ErrRequired error struct for a required parameter
func NewErrRequired ¶
func NewErrRequired(what string) ErrRequired
NewErrRequired returns a new ErrRequiredstruct
type ErrTimeout ¶
type ErrTimeout struct {
// contains filtered or unexported fields
}
ErrTimeout describes an error when an operation timed out
func NewErrTimeout ¶
func NewErrTimeout(what string) ErrTimeout
NewErrTimeout returns a new ErrAborted struct
type ErrUnknown ¶
type ErrUnknown struct {
// contains filtered or unexported fields
}
ErrUnknown describes the error which a parameter was unknown
func NewErrUnknown ¶
func NewErrUnknown(what string) ErrUnknown
NewErrUnknown returns a new ErrUnknown struct