schema

package
v0.1.0-memsql Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemasAttribute = &Attribute{
		MultiValued: true,
		Mutability:  Immutable,
		Name:        "schemas",
		Type:        StringType,
		Required:    true,
	}
	IDAttribute = &Attribute{
		CaseExact:   true,
		Description: "A unique identifier for a SCIM resource as defined by the service provider.",
		Mutability:  ReadOnly,
		Name:        "id",
		Type:        StringType,
		Required:    true,
		Returned:    Always,
		Uniqueness:  Server,
	}
	ExternalIDAttribute = &Attribute{
		CaseExact:   true,
		Description: "A String that is an identifier for the resource as defined by the\nprovisioning client.",
		Name:        "externalId",
		Type:        StringType,
	}
	MetaAttribute = &Attribute{
		Description: "A complex attribute containing resource metadata.",
		Mutability:  ReadOnly,
		Name:        "meta",
		Type:        ComplexType,
		SubAttributes: []*Attribute{
			{
				CaseExact:   true,
				Description: "The name of the resource type of the resource.",
				Mutability:  ReadOnly,
				Name:        "resourceType",
			},
			{
				Description: "The DateTime that the resource was added to the service provider.",
				Mutability:  ReadOnly,
				Name:        "created",
			},
			{
				Description: "The most recent DateTime that the details of this resource were updated at the service provider.",
				Mutability:  ReadOnly,
				Name:        "lastModified",
			},
			{
				Description: "The URI of the resource being returned.",
				Mutability:  ReadOnly,
				Name:        "location",
			},
			{
				CaseExact:   true,
				Description: "The version of the resource being returned.",
				Mutability:  ReadOnly,
				Name:        "version",
			},
		},
	}

	CoreAttributes = []*Attribute{
		SchemasAttribute,
		IDAttribute,
		ExternalIDAttribute,
		MetaAttribute,
	}
)

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name            string       `json:"name"`
	Type            Type         `json:"type"`
	SubAttributes   []*Attribute `json:"subAttributes,omitempty"`
	MultiValued     bool         `json:"multiValued"`
	Description     string       `json:"description,omitempty"`
	Required        bool         `json:"required"`
	CanonicalValues []string     `json:"canonicalValues,omitempty"`
	CaseExact       bool         `json:"caseExact"`
	Mutability      Mutability   `json:"mutability"`
	Returned        Returned     `json:"returned"`
	Uniqueness      Uniqueness   `json:"uniqueness"`
	ReferenceTypes  []string     `json:"referenceTypes"`
}

Attribute represents an attribute of a ReferenceSchema.

func (*Attribute) ForEachAttribute

func (attribute *Attribute) ForEachAttribute(f func(attribute *Attribute))

ForEachAttribute calls given function on itself all sub attributes recursively.

type Mutability

type Mutability string
const (
	ReadOnly  Mutability = "readOnly"
	ReadWrite Mutability = "readWrite"
	Immutable Mutability = "immutable"
	WriteOnly Mutability = "writeOnly"
)

type ReferenceSchema

type ReferenceSchema struct {
	ID          string       `json:"id"`
	Name        string       `json:"name,omitempty"`
	Description string       `json:"description,omitempty"`
	Attributes  []*Attribute `json:"attributes"`
}

ReferenceSchema represents a resource schema that is used to fuzz resources that are defined by this schema.

func (ReferenceSchema) ForEachAttribute

func (s ReferenceSchema) ForEachAttribute(f func(attribute *Attribute))

ForEachAttribute calls given function on all attributes recursively.

type Returned

type Returned string
const (
	Always  Returned = "always"
	Never   Returned = "never"
	Default Returned = "default"
	Request Returned = "request"
)

type Type

type Type string
const (
	StringType    Type = "string"
	BooleanType   Type = "boolean"
	BinaryType    Type = "binary"
	DecimalType   Type = "decimal"
	IntegerType   Type = "integer"
	DateTimeType  Type = "dateTime"
	ReferenceType Type = "reference"
	ComplexType   Type = "complex"
)

type Uniqueness

type Uniqueness string
const (
	None   Uniqueness = "none"
	Server Uniqueness = "server"
	Global Uniqueness = "global"
)

Jump to

Keyboard shortcuts

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