schema

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSONSchema is the libStorage API JSON schema
	JSONSchema = `` /* 18203-byte string literal not displayed */

)

Variables

View Source
var (

	// VolumeSchema is the JSON schema for the Volume resource.
	VolumeSchema = buildSchemaVar("volume")

	// VolumeAttachmentSchema is the JSON schema for the VolumeAttachment
	// resource.
	VolumeAttachmentSchema = buildSchemaVar("volumeAttachment")

	// ServiceVolumeMapSchema is the JSON schema for the ServiceVolumeMap
	// resource.
	ServiceVolumeMapSchema = buildSchemaVar("serviceVolumeMap")

	// ServiceSnapshotMapSchema is the JSON schema for the ServiceSnapshotMap
	// resource.
	ServiceSnapshotMapSchema = buildSchemaVar("serviceSnapshotMap")

	// VolumeMapSchema is the JSON schema for the VolumeMap resource.
	VolumeMapSchema = buildSchemaVar("volumeMap")

	// SnapshotMapSchema is the JSON schema for the SnapshotMap resource.
	SnapshotMapSchema = buildSchemaVar("snapshotMap")

	// SnapshotSchema is the JSON schema for the Snapshot resource.
	SnapshotSchema = buildSchemaVar("snapshot")

	// ServiceInfoSchema is the JSON schema for the ServiceInfo resource.
	ServiceInfoSchema = buildSchemaVar("serviceInfo")

	// ServiceInfoMapSchema is the JSON schemea for a map[string]*ServiceInfo.
	ServiceInfoMapSchema = buildSchemaVar("serviceInfoMap")

	// DriverInfoSchema is the JSON schema for the DriverInfo resource.
	DriverInfoSchema = buildSchemaVar("driverInfo")

	// ExecutorInfoSchema is the JSON schema for the ExecutorInfo resource.
	ExecutorInfoSchema = buildSchemaVar("executorInfo")

	// VolumeCreateRequestSchema is the JSON schema for a Volume creation
	// request.
	VolumeCreateRequestSchema = buildSchemaVar("volumeCreateRequest")

	// VolumeCopyRequestSchema is the JSON schema for a Volume copy
	// request.
	VolumeCopyRequestSchema = buildSchemaVar("volumeCopyRequest")

	// VolumeSnapshotRequestSchema is the JSON schema for a Volume snapshot
	// request.
	VolumeSnapshotRequestSchema = buildSchemaVar("volumeSnapshotRequest")

	// VolumeAttachRequestSchema is the JSON schema for a Volume attach
	// request.
	VolumeAttachRequestSchema = buildSchemaVar("volumeAttachRequest")

	// VolumeAttachResponseSchema is the JSON schema for a Volume attach
	// response.
	VolumeAttachResponseSchema = buildSchemaVar("volumeAttachResponse")

	// VolumeDetachRequestSchema is the JSON schema for a Volume detach
	// request.
	VolumeDetachRequestSchema = buildSchemaVar("volumeDetachRequest")

	// SnapshotCopyRequestSchema is the JSON schema for a Snapshot copy
	// request.
	SnapshotCopyRequestSchema = buildSchemaVar("snapshotCopyRequest")

	// VolumeCreateFromSnapshotRequestSchema is the JSON schema for a
	// Volume create from Snapshot request.
	VolumeCreateFromSnapshotRequestSchema = buildSchemaVar(
		"volumeCreateFromSnapshotRequest")
)

Functions

func Validate

func Validate(ctx types.Context, s, d []byte) error

Validate validates the provided data (d) against the provided schema (s).

func ValidateObj

func ValidateObj(ctx types.Context, s []byte, i interface{}) error

ValidateObj validates an object using a schema.

func ValidateSnapshot

func ValidateSnapshot(v *types.Snapshot) ([]byte, error)

ValidateSnapshot validates a Snapshot object using the JSON schema. If the object is valid no error is returned. The first return value, the object marshaled to JSON, is returned whether or not the validation is successful.

func ValidateVolume

func ValidateVolume(v *types.Volume) ([]byte, error)

ValidateVolume validates a Volume object using the JSON schema. If the object is valid no error is returned. The first return value, the object marshaled to JSON, is returned whether or not the validation is successful.

func ValidateVolumeCreateRequest

func ValidateVolumeCreateRequest(
	v *types.VolumeCreateRequest) ([]byte, error)

ValidateVolumeCreateRequest validates a VolumeCreateRequest object using the JSON schema. If the object is valid no error is returned. The first return value, the object marshaled to JSON, is returned whether or not the validation is successful.

func ValidateVolumeSnapshotRequest

func ValidateVolumeSnapshotRequest(
	v *types.VolumeSnapshotRequest) ([]byte, error)

ValidateVolumeSnapshotRequest validates a VolumeSnapshotRequest object using the JSON schema. If the object is valid no error is returned. The first return value, the object marshaled to JSON, is returned whether or not the validation is successful.

Types

This section is empty.

Jump to

Keyboard shortcuts

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