Documentation ¶
Index ¶
Constants ¶
const APIVersion = "brigade.sh/v2"
APIVersion represents the API and major version thereof with which this version of the Brigade API server is compatible.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrAuthentication ¶
type ErrAuthentication struct { // Reason is a natural language explanation for why authentication failed. Reason string `json:"reason,omitempty"` }
ErrAuthentication represents an error asserting an principal's identity.
func (*ErrAuthentication) Error ¶
func (e *ErrAuthentication) Error() string
func (ErrAuthentication) MarshalJSON ¶
func (e ErrAuthentication) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrAuthentication instances with type metadata.
type ErrAuthorization ¶
type ErrAuthorization struct { // Reason is a natural language explanation for why authorization failed. Reason string `json:"reason,omitempty"` }
ErrAuthorization represents an error wherein a principal was not authorized to perform the requested operation.
func (*ErrAuthorization) Error ¶
func (e *ErrAuthorization) Error() string
func (ErrAuthorization) MarshalJSON ¶
func (e ErrAuthorization) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrAuthorization instances with type metadata.
type ErrBadRequest ¶
type ErrBadRequest struct { // Reason is a natural language explanation for why the request is invalid. Reason string `json:"reason,omitempty"` // Details may further qualify why a request is invalid. For instance, if // the Reason field states that request validation failed, the Details field, // may enumerate specific request schema violations. Details []string `json:"details,omitempty"` }
ErrBadRequest represents an error wherein an invalid request has been rejected by the API server.
func (*ErrBadRequest) Error ¶
func (e *ErrBadRequest) Error() string
func (ErrBadRequest) MarshalJSON ¶
func (e ErrBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrBadRequest instances with type metadata.
type ErrConflict ¶
type ErrConflict struct { // Type identifies the type of the resource that the conflict applies to. Type string `json:"type,omitempty"` // ID is the identifier of the resource that has encountered a conflict. ID string `json:"id,omitempty"` // Reason is a natural language explanation of the conflict. Reason string `json:"reason,omitempty"` }
ErrConflict represents an error wherein a request cannot be completed because it would violate some constrain of the system, for instance creating a new resource with an identifier already used by another resource of the same type.
func (*ErrConflict) Error ¶
func (e *ErrConflict) Error() string
func (ErrConflict) MarshalJSON ¶
func (e ErrConflict) MarshalJSON() ([]byte, error)
MarshalJSON amends MarshalJSON instances with type metadata.
type ErrInternalServer ¶
type ErrInternalServer struct{}
ErrInternalServer represents a condition wherein the API server has encountered an unexpected error and does not wish to communicate further details of that error to the client.
func (*ErrInternalServer) Error ¶
func (e *ErrInternalServer) Error() string
func (ErrInternalServer) MarshalJSON ¶
func (e ErrInternalServer) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrInternalServer instances with type metadata.
type ErrNotFound ¶
type ErrNotFound struct { // Type identifies the type of the resource that could not be located. Type string `json:"type,omitempty"` // ID is the identifier of the resource of type Type that could not be // located. ID string `json:"id,omitempty"` // Reason is a natural language explanation around why the resource could not // be located. Reason string `json:"reason,omitempty"` }
ErrNotFound represents an error wherein a resource presumed to exist could not be located.
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
func (ErrNotFound) MarshalJSON ¶
func (e ErrNotFound) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrNotFound instances with type metadata.
type ErrNotSupported ¶
type ErrNotSupported struct { // Details is a natural language explanation of why the request was is not // supported by the API server. Details string `json:"reason,omitempty"` }
ErrNotSupported represents an error wherein a request cannot be completed because the API server explicitly does not support it. This can occur, for instance, if a client attempts to authenticate to the API server using an authentication mechanism that is explicitly disabled by the API server.
func (*ErrNotSupported) Error ¶
func (e *ErrNotSupported) Error() string
func (ErrNotSupported) MarshalJSON ¶
func (e ErrNotSupported) MarshalJSON() ([]byte, error)
MarshalJSON amends ErrNotSupported instances with type metadata.
type List ¶ added in v2.4.0
type List[T any] struct { // ListMeta contains list metadata. ListMeta `json:"metadata"` // Items is a slice of items of type T. Items []T `json:"items,omitempty"` }
List is a generic type that represents an ordered and pageable collection.
func (List[T]) MarshalJSON ¶ added in v2.4.0
func (List[T]) Sort ¶ added in v2.4.0
Sort sorts the contents of a List's Items field. Because List is a generic type and cannot know how to compare all types, this function takes a comparison function as an argument. The comparison function MUST return an int value < 0 when its first argument is less than the second argument, 0 when its first and second arguments are equal, and a in value > 0 when the first argument is greater than the second.
type ListMeta ¶
type ListMeta struct { // Continue, when non-empty is an opaque value created by and understood by an // API operation that returns partial (pageable) results. Submitting this // value with subsequent requests to the same operation specifies to that // operation which page to return next. Continue string `json:"continue,omitempty"` // RemainingItemCount, when non-nil indicates that an API operation returned // partial (pageable) results and indicates how many results remain. RemainingItemCount int64 `json:"remainingItemCount"` }
ListMeta is metadata for ordered collections of resources.
type ListOptions ¶
type ListOptions struct { // Continue aids in pagination of long lists. It permits clients to echo an // opaque value obtained from a previous API call back to the API in a // subsequent call in order to indicate what resource was the last on the // previous page. Continue string // Limit aids in pagination of long lists. It permits clients to specify page // size when making API calls. The API server provides a default when a value // is not specified and may reject or override invalid values (non-positive) // numbers or very large page sizes. Limit int64 }
ListOptions represents useful resource selection criteria when fetching paginated lists of resources.
type ObjectMeta ¶
type ObjectMeta struct { // ID is an immutable resource identifier. ID string `json:"id,omitempty" bson:"id,omitempty"` // Created indicates the time at which a resource was created. Created *time.Time `json:"created,omitempty" bson:"created,omitempty"` }
ObjectMeta represents metadata about an instance of a resource. The fields of this type are broadly applicable to most if not all resource types.
type TypeMeta ¶
type TypeMeta struct { // Kind specifies the type of a serialized resource. Kind string `json:"kind,omitempty"` // APIVersion specifiesthe major version of the Brigade API with which the // client or server having serialized the resource is compatible. APIVersion string `json:"apiVersion,omitempty"` }
TypeMeta represents metadata about a resource type to help clients and servers mutually head off potential confusion over types (and versions of thereof) sent over the wire.