status

package
v0.65.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExtraSettingsNotFound = errors.New("extra settings not found")
	ErrPeerAlreadyLoggedIn   = errors.New("peer with the same public key is already logged in")
)

Functions

func Errorf

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

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

func NewAccountNotFoundError

func NewAccountNotFoundError(accountKey string) error

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

func NewAccountOnboardingNotFoundError

func NewAccountOnboardingNotFoundError(accountKey string) error

NewAccountOnboardingNotFoundError creates a new Error with NotFound type for a missing account onboarding

func NewAdminPermissionError

func NewAdminPermissionError() error

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

func NewDNSRecordNotFoundError added in v0.63.0

func NewDNSRecordNotFoundError(recordID string) error

NewDNSRecordNotFoundError creates a new Error with NotFound type for a missing dns record.

func NewExtraSettingsNotFoundError

func NewExtraSettingsNotFoundError() error

func NewGetAccountError

func NewGetAccountError(err error) error

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

func NewGetAccountFromStoreError

func NewGetAccountFromStoreError(err error) error

func NewGetUserFromStoreError

func NewGetUserFromStoreError() error

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

func NewGroupNotFoundError

func NewGroupNotFoundError(groupID string) error

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

func NewInvalidKeyIDError

func NewInvalidKeyIDError() error

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

func NewNameServerGroupNotFoundError

func NewNameServerGroupNotFoundError(nsGroupID string) error

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

func NewNetworkNotFoundError

func NewNetworkNotFoundError(networkID string) error

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

func NewNetworkResourceNotFoundError

func NewNetworkResourceNotFoundError(resourceID string) error

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

func NewNetworkRouterNotFoundError

func NewNetworkRouterNotFoundError(routerID string) error

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

func NewOperationNotFoundError

func NewOperationNotFoundError(operation operations.Operation) error

func NewOwnerDeletePermissionError

func NewOwnerDeletePermissionError() error

NewOwnerDeletePermissionError creates a new Error with PermissionDenied type for attempting to delete a user with the owner role.

func NewPATNotFoundError

func NewPATNotFoundError(patID string) error

func NewPeerInUseError added in v0.65.0

func NewPeerInUseError(peerID string, proxyID string) error

func NewPeerLoginExpiredError

func NewPeerLoginExpiredError() error

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

func NewPeerLoginMismatchError

func NewPeerLoginMismatchError() error

NewPeerLoginMismatchError creates a new Error with Unauthenticated type for a peer that is already registered for another user

func NewPeerNotFoundError

func NewPeerNotFoundError(peerKey string) error

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

func NewPeerNotPartOfAccountError

func NewPeerNotPartOfAccountError() error

NewPeerNotPartOfAccountError creates a new Error with PermissionDenied type for a peer not being part of an account

func NewPeerNotRegisteredError

func NewPeerNotRegisteredError() error

NewPeerNotRegisteredError creates a new Error with Unauthenticated type unregistered peer

func NewPermissionDeniedError

func NewPermissionDeniedError() error

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

func NewPermissionValidationError

func NewPermissionValidationError(err error) error

func NewPolicyNotFoundError

func NewPolicyNotFoundError(policyID string) error

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

func NewPostureChecksNotFoundError

func NewPostureChecksNotFoundError(postureChecksID string) error

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

func NewResourceInUseError added in v0.65.0

func NewResourceInUseError(resourceID string, proxyID string) error

func NewResourceNotPartOfNetworkError

func NewResourceNotPartOfNetworkError(resourceID, networkID string) error

func NewRouteNotFoundError

func NewRouteNotFoundError(routeID string) error

func NewRouterNotPartOfNetworkError

func NewRouterNotPartOfNetworkError(routerID, networkID string) error

func NewServiceUserRoleInvalidError

func NewServiceUserRoleInvalidError() error

NewServiceUserRoleInvalidError creates a new Error with InvalidArgument type for creating a service user with owner role

func NewSetupKeyNotFoundError

func NewSetupKeyNotFoundError(setupKeyID string) error

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

func NewUserBlockedError

func NewUserBlockedError() error

NewUserBlockedError creates a new Error with PermissionDenied type for a blocked user

func NewUserNotFoundError

func NewUserNotFoundError(userKey string) error

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

func NewUserNotPartOfAccountError

func NewUserNotPartOfAccountError() error

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

func NewUserPendingApprovalError added in v0.56.0

func NewUserPendingApprovalError() error

NewUserPendingApprovalError creates a new Error with PermissionDenied type for a blocked user pending approval

func NewUserRoleNotFoundError

func NewUserRoleNotFoundError(role string) error

func NewZoneNotFoundError added in v0.63.0

func NewZoneNotFoundError(zoneID string) error

NewZoneNotFoundError creates a new Error with NotFound type for a missing dns zone.

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

	// TooManyRequests indicates that the user has sent too many requests in a given amount of time (rate limiting)
	TooManyRequests Type = 11
)

Jump to

Keyboard shortcuts

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