resources

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuditPropertyCreatedBy = &model.ResourceProperty{
	Name:      "createdBy",
	Type:      model.ResourceProperty_STRING,
	Mapping:   "created_by",
	Length:    256,
	Required:  true,
	Immutable: true,
	Primary:   false,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}
View Source
var AuditPropertyCreatedOn = &model.ResourceProperty{
	Name:      "createdOn",
	Type:      model.ResourceProperty_TIMESTAMP,
	Mapping:   "created_on",
	Required:  true,
	Immutable: true,
	Primary:   false,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}
View Source
var AuditPropertyUpdatedBy = &model.ResourceProperty{
	Name:     "updatedBy",
	Type:     model.ResourceProperty_STRING,
	Mapping:  "updated_by",
	Length:   256,
	Required: false,
	Primary:  false,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}
View Source
var AuditPropertyUpdatedOn = &model.ResourceProperty{
	Name:     "updatedOn",
	Type:     model.ResourceProperty_TIMESTAMP,
	Mapping:  "updated_on",
	Required: false,
	Primary:  false,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}
View Source
var DataSourceResource = &model.Resource{
	Name:      "data-source",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "data_source",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:     "name",
			Mapping:  "name",
			Length:   64,
			Primary:  false,
			Unique:   true,
			Type:     model.ResourceProperty_STRING,
			Required: true,
			Annotations: map[string]string{
				annotations.IsHclLabel: annotations.Enabled,
			},
		},
		{
			Name:     "description",
			Mapping:  "description",
			Length:   64,
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Required: false,
		},
		{
			Name:     "backend",
			Mapping:  "backend",
			Primary:  false,
			Type:     model.ResourceProperty_INT32,
			Required: true,
		},

		{
			Name:     "options_postgres_username",
			Mapping:  "options_postgres_username",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_postgres_password",

			Mapping:  "options_postgres_password",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_postgres_host",

			Mapping:  "options_postgres_host",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_postgres_port",

			Mapping:  "options_postgres_port",
			Type:     model.ResourceProperty_INT32,
			Required: false,
		},
		{
			Name: "options_postgres_db_name",

			Mapping:  "options_postgres_db_name",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_postgres_default_schema",

			Mapping:  "options_postgres_default_schema",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},

		{
			Name:     "options_mysql_username",
			Mapping:  "options_mysql_username",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_mysql_password",

			Mapping:  "options_mysql_password",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_mysql_host",

			Mapping:  "options_mysql_host",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_mysql_port",

			Mapping:  "options_mysql_port",
			Type:     model.ResourceProperty_INT32,
			Required: false,
		},
		{
			Name: "options_mysql_db_name",

			Mapping:  "options_mysql_db_name",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_mysql_default_schema",

			Mapping:  "options_mysql_default_schema",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: false,
		},
		{
			Name: "options_redis_addr",

			Mapping:  "options_redis_addr",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name: "options_redis_password",

			Mapping:  "options_redis_password",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name: "options_redis_db",

			Mapping:  "options_redis_db",
			Type:     model.ResourceProperty_INT32,
			Required: false,
		},
		{
			Name: "options_mongo_uri",

			Mapping:  "options_mongo_uri",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name: "options_mongo_db_name",

			Mapping:  "options_mongo_db_name",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var ExtensionResource = &model.Resource{
	Name:      "extension",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "extension",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:     "name",
			Mapping:  "name",
			Length:   64,
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Unique:   true,
			Required: true,
			Annotations: map[string]string{
				annotations.IsHclLabel: annotations.Enabled,
			},
		},
		{
			Name:     "description",
			Mapping:  "description",
			Length:   64,
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Required: false,
		},
		{
			Name:     "selector",
			Mapping:  "selector",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "order",
			Mapping:  "order",
			Primary:  false,
			Type:     model.ResourceProperty_INT32,
			Required: true,
		},
		{
			Name:     "finalizes",
			Mapping:  "finalizes",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "sync",
			Mapping:  "sync",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "responds",
			Mapping:  "responds",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "call",
			Mapping:  "call",
			Type:     model.ResourceProperty_OBJECT,
			Required: true,
		},
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var IdProperty = &model.ResourceProperty{
	Name:      "id",
	Type:      model.ResourceProperty_UUID,
	Mapping:   "id",
	Required:  true,
	Immutable: true,
	Primary:   true,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}
View Source
var NamespaceResource = &model.Resource{
	Name:      "namespace",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "namespace",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:      "name",
			Mapping:   "name",
			Primary:   false,
			Type:      model.ResourceProperty_STRING,
			Length:    256,
			Required:  true,
			Unique:    true,
			Immutable: true,
			Annotations: map[string]string{
				annotations.IsHclLabel: annotations.Enabled,
			},
		},
		{
			Name: "description",

			Mapping:  "description",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name: "details",

			Mapping:  "details",
			Primary:  false,
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		securityContextProperty,
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var ResourcePropertyResource = &model.Resource{
	Name:      "resourceProperty",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "resource_property",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:     "name",
			Mapping:  "name",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: true,
		},
		{
			Name:     "type",
			Mapping:  "type",
			Type:     model.ResourceProperty_INT32,
			Required: true,
		},
		{
			Name:     "mapping",
			Mapping:  "mapping",
			Type:     model.ResourceProperty_STRING,
			Length:   64,
			Required: true,
		},
		{
			Name:     "primary",
			Mapping:  "primary",
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "required",
			Mapping:  "required",
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "unique",
			Mapping:  "unique",
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "immutable",
			Mapping:  "immutable",
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "length",
			Mapping:  "length",
			Type:     model.ResourceProperty_INT32,
			Required: true,
		},
		{
			Name:     "resource",
			Mapping:  "resource",
			Type:     model.ResourceProperty_REFERENCE,
			Required: true,
			Reference: &model.Reference{
				ReferencedResource: ResourceResource.Name,
				Cascade:            true,
			},
		},
		{
			Name:     "subProperty",
			Mapping:  "sub_property",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "properties",
			Mapping:  "properties",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:    "reference_resource",
			Mapping: "reference_resource",
			Type:    model.ResourceProperty_REFERENCE,
			Reference: &model.Reference{
				ReferencedResource: ResourceResource.Name,
				Cascade:            true,
			},
			Required: false,
		},
		{
			Name:     "reference_cascade",
			Mapping:  "reference_cascade",
			Type:     model.ResourceProperty_BOOL,
			Required: false,
		},
		securityContextProperty,
		{
			Name:     "defaultValue",
			Mapping:  "default_value",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "enumValues",
			Mapping:  "enum_values",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "exampleValue",
			Mapping:  "example_value",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "title",
			Mapping:  "title",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name:     "description",
			Mapping:  "description",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name:     "annotations",
			Mapping:  "annotations",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
	},
	Indexes: []*model.ResourceIndex{
		{
			Properties: []*model.ResourceIndexProperty{
				{
					Name: "resource",
				}, {
					Name: "name",
				},
			},
			Unique: true,
		},
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var ResourceResource = &model.Resource{
	Name:      "resource",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "resource",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:     "name",
			Mapping:  "name",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: true,
			Unique:   false,
			Annotations: map[string]string{
				annotations.IsHclLabel: annotations.Enabled,
			},
		},
		{
			Name:     "namespace",
			Mapping:  "namespace",
			Type:     model.ResourceProperty_REFERENCE,
			Required: true,
			Reference: &model.Reference{
				ReferencedResource: NamespaceResource.Name,
				Cascade:            false,
			},
		},
		{
			Name:     "virtual",
			Mapping:  "virtual",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "immutable",
			Mapping:  "immutable",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "abstract",
			Mapping:  "abstract",
			Primary:  false,
			Type:     model.ResourceProperty_BOOL,
			Required: true,
		},
		{
			Name:     "dataSource",
			Mapping:  "source_data_source",
			Type:     model.ResourceProperty_REFERENCE,
			Required: false,
			Reference: &model.Reference{
				ReferencedResource: DataSourceResource.Name,
				Cascade:            false,
			},
		},
		{
			Name:     "entity",
			Mapping:  "mapping",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name:     "catalog",
			Mapping:  "source_catalog",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name:     "annotations",
			Mapping:  "annotations",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		{
			Name:     "indexes",
			Mapping:  "indexes",
			Type:     model.ResourceProperty_OBJECT,
			Required: false,
		},
		securityContextProperty,
		{
			Name:     "title",
			Mapping:  "title",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
		{
			Name:     "description",
			Mapping:  "description",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: false,
		},
	},
	Indexes: []*model.ResourceIndex{
		{
			Properties: []*model.ResourceIndexProperty{
				{
					Name: "namespace",
				},
				{
					Name: "name",
				},
			},
			Unique: true,
		},
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var UserResource = &model.Resource{
	Name:      "user",
	Namespace: "system",
	SourceConfig: &model.ResourceSourceConfig{
		DataSource: "system",
		Entity:     "user",
	},
	Properties: []*model.ResourceProperty{
		IdProperty,
		VersionProperty,
		AuditProperties[0],
		AuditProperties[1],
		AuditProperties[2],
		AuditProperties[3],
		{
			Name:     "username",
			Mapping:  "username",
			Primary:  false,
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: true,
			Unique:   true,
			Annotations: map[string]string{
				annotations.IsHclLabel: annotations.Enabled,
			},
		},
		{
			Name: "password",

			Mapping:  "password",
			Type:     model.ResourceProperty_STRING,
			Length:   256,
			Required: true,
		},
		securityContextProperty,
		{
			Name: "details",

			Mapping:         "details",
			Type:            model.ResourceProperty_OBJECT,
			SecurityContext: securityContextDisallowAll,
		},
	},
	SecurityContext: securityContextDisallowAll,
	Annotations: map[string]string{
		annotations.EnableAudit: "true",
	},
}
View Source
var VersionProperty = &model.ResourceProperty{
	Name:     "version",
	Type:     model.ResourceProperty_INT32,
	Mapping:  "version",
	Required: true,
	Primary:  false,
	Annotations: map[string]string{
		annotations.SpecialProperty: "true",
	},
}

Functions

func GetAllSystemResources

func GetAllSystemResources() []*model.Resource

func GetSystemResourceType

func GetSystemResourceType(resource *model.Resource) proto.Message

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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