status

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: BSD-3-Clause Imports: 2 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(errorType Type, format string, a ...interface{}) error

Errorf returns Error(ErrorType, fmt.Sprintf(format, a...)).

func NewAccountNotFoundError added in v0.28.0

func NewAccountNotFoundError(accountKey string) error

NewAccountNotFoundError creates a new Error with NotFound type for a missing account

func NewAdminPermissionError added in v0.32.0

func NewAdminPermissionError() error

NewAdminPermissionError creates a new Error with PermissionDenied type for actions requiring admin role.

func NewGetAccountError added in v0.32.0

func NewGetAccountError(err error) error

NewGetAccountError creates a new Error with Internal type for an issue getting account

func NewGetAccountFromStoreError added in v0.30.1

func NewGetAccountFromStoreError(err error) error

func NewGetUserFromStoreError added in v0.29.3

func NewGetUserFromStoreError() error

NewGetUserFromStoreError creates a new Error with Internal type for an issue getting user from store

func NewGroupNotFoundError added in v0.32.0

func NewGroupNotFoundError(groupID string) error

NewGroupNotFoundError creates a new Error with NotFound type for a missing group

func NewInvalidKeyIDError added in v0.31.0

func NewInvalidKeyIDError() error

NewInvalidKeyIDError creates a new Error with InvalidArgument type for an issue getting a setup key

func NewNameServerGroupNotFoundError added in v0.34.0

func NewNameServerGroupNotFoundError(nsGroupID string) error

NewNameServerGroupNotFoundError creates a new Error with NotFound type for a missing name server group

func NewNetworkNotFoundError added in v0.35.0

func NewNetworkNotFoundError(networkID string) error

NewNetworkNotFoundError creates a new Error with NotFound type for a missing network.

func NewNetworkResourceNotFoundError added in v0.35.0

func NewNetworkResourceNotFoundError(resourceID string) error

NewNetworkResourceNotFoundError creates a new Error with NotFound type for a missing network resource.

func NewNetworkRouterNotFoundError added in v0.35.0

func NewNetworkRouterNotFoundError(routerID string) error

NewNetworkRouterNotFoundError creates a new Error with NotFound type for a missing network router.

func NewPeerLoginExpiredError added in v0.28.7

func NewPeerLoginExpiredError() error

NewPeerLoginExpiredError creates a new Error with PermissionDenied type for an expired peer

func NewPeerNotFoundError added in v0.28.0

func NewPeerNotFoundError(peerKey string) error

NewPeerNotFoundError creates a new Error with NotFound type for a missing peer

func NewPeerNotRegisteredError added in v0.28.0

func NewPeerNotRegisteredError() error

NewPeerNotRegisteredError creates a new Error with NotFound type for a missing peer

func NewPermissionDeniedError added in v0.35.0

func NewPermissionDeniedError() error

NewPermissionDeniedError creates a new Error with PermissionDenied type for a permission denied error.

func NewPermissionValidationError added in v0.35.0

func NewPermissionValidationError(err error) error

func NewPolicyNotFoundError added in v0.34.0

func NewPolicyNotFoundError(policyID string) error

NewPolicyNotFoundError creates a new Error with NotFound type for a missing policy

func NewPostureChecksNotFoundError added in v0.34.0

func NewPostureChecksNotFoundError(postureChecksID string) error

NewPostureChecksNotFoundError creates a new Error with NotFound type for a missing posture checks

func NewResourceNotPartOfNetworkError added in v0.35.0

func NewResourceNotPartOfNetworkError(resourceID, networkID string) error

func NewRouterNotPartOfNetworkError added in v0.35.0

func NewRouterNotPartOfNetworkError(routerID, networkID string) error

func NewSetupKeyNotFoundError added in v0.29.3

func NewSetupKeyNotFoundError(setupKeyID string) error

NewSetupKeyNotFoundError creates a new Error with NotFound type for a missing setup key

func NewUserNotFoundError added in v0.28.0

func NewUserNotFoundError(userKey string) error

NewUserNotFoundError creates a new Error with NotFound type for a missing user

func NewUserNotPartOfAccountError added in v0.32.0

func NewUserNotPartOfAccountError() error

NewUserNotPartOfAccountError creates a new Error with PermissionDenied type for a user not being part of an account

Types

type Error

type Error struct {
	ErrorType Type
	Message   string
}

Error is an internal error

func FromError

func FromError(err error) (s *Error, ok bool)

FromError returns Error, true if the provided error is of type of Error. nil, false otherwise

func (*Error) Error

func (e *Error) Error() string

Error is an error string

func (*Error) Type

func (e *Error) Type() Type

Type returns the Type of the error

type Type

type Type int32

Type is a type of the Error

const (
	// UserAlreadyExists indicates that user already exists
	UserAlreadyExists Type = 1

	// PreconditionFailed indicates that some pre-condition for the operation hasn't been fulfilled
	PreconditionFailed Type = 2

	// PermissionDenied indicates that user has no permissions to view data
	PermissionDenied Type = 3

	// NotFound indicates that the object wasn't found in the system (or under a given Account)
	NotFound Type = 4

	// Internal indicates some generic internal error
	Internal Type = 5

	// InvalidArgument indicates some generic invalid argument error
	InvalidArgument Type = 6

	// AlreadyExists indicates a generic error when an object already exists in the system
	AlreadyExists Type = 7

	// Unauthorized indicates that user is not authorized
	Unauthorized Type = 8

	// BadRequest indicates that user is not authorized
	BadRequest Type = 9

	// Unauthenticated indicates that user is not authenticated due to absence of valid credentials
	Unauthenticated Type = 10
)

Jump to

Keyboard shortcuts

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