Documentation ¶
Index ¶
- Variables
- func GetBuiltinJs(name string) string
- func NewModule(container service.Container) service.Module
- type Code
- func (s *Code) GetAnnotations() map[string]string
- func (s *Code) GetAuditData() *CodeAuditData
- func (s *Code) GetContent() string
- func (s *Code) GetContentFormat() CodeContentFormat
- func (s *Code) GetId() *uuid.UUID
- func (s *Code) GetLanguage() CodeLanguage
- func (s *Code) GetName() string
- func (s *Code) GetVersion() int32
- type CodeAuditData
- type CodeAuditDataMapper
- func (m *CodeAuditDataMapper) FromProperties(properties map[string]*structpb.Value) *CodeAuditData
- func (m *CodeAuditDataMapper) New() *CodeAuditData
- func (m *CodeAuditDataMapper) ResourceIdentity() abs.ResourceIdentity
- func (m *CodeAuditDataMapper) ToProperties(codeAuditData *CodeAuditData) map[string]*structpb.Value
- func (m *CodeAuditDataMapper) ToUnstructured(codeAuditData *CodeAuditData) unstructured.Unstructured
- type CodeContentFormat
- type CodeLanguage
- type CodeMapper
- func (m *CodeMapper) FromProperties(properties map[string]*structpb.Value) *Code
- func (m *CodeMapper) FromRecord(record *model.Record) *Code
- func (m *CodeMapper) New() *Code
- func (m *CodeMapper) ResourceIdentity() abs.ResourceIdentity
- func (m *CodeMapper) ToProperties(code *Code) map[string]*structpb.Value
- func (m *CodeMapper) ToRecord(code *Code) *model.Record
- func (m *CodeMapper) ToUnstructured(code *Code) unstructured.Unstructured
Constants ¶
This section is empty.
Variables ¶
View Source
var CodeAuditDataMapperInstance = NewCodeAuditDataMapper()
View Source
var CodeMapperInstance = NewCodeMapper()
View Source
var CodeResource = &model.Resource{ Name: "Code", Namespace: "nano", Title: util.Pointer("Code"), Description: util.Pointer("Nano code"), Types: []*model.ResourceSubType{ { Name: "AuditData", Title: "Audit Data", Description: "Audit Data is a type that represents the audit data of a resource/record. ", Properties: []*model.ResourceProperty{ { Name: "createdBy", Type: model.ResourceProperty_STRING, Length: 256, Immutable: true, ExampleValue: structpb.NewStringValue("admin"), Annotations: map[string]string{ "SpecialProperty": "true", }, }, { Name: "updatedBy", Type: model.ResourceProperty_STRING, Length: 256, ExampleValue: structpb.NewStringValue("admin"), Annotations: map[string]string{ "SpecialProperty": "true", }, }, { Name: "createdOn", Type: model.ResourceProperty_TIMESTAMP, Immutable: true, ExampleValue: structpb.NewStringValue("2024-03-28T17:16:51+04:00"), Annotations: map[string]string{ "SpecialProperty": "true", }, }, { Name: "updatedOn", Type: model.ResourceProperty_TIMESTAMP, ExampleValue: structpb.NewStringValue("2024-03-28T17:16:51+04:00"), Annotations: map[string]string{ "SpecialProperty": "true", }, }, }, Annotations: map[string]string{ "EnableAudit": "true", "OpenApiGroup": "meta", "NormalizedResource": "true", }, }, }, Properties: []*model.ResourceProperty{ { Name: "id", Type: model.ResourceProperty_UUID, Primary: true, Required: true, Immutable: true, ExampleValue: structpb.NewStringValue("a39621a4-6d48-11ee-b962-0242ac120002"), Annotations: map[string]string{ "SpecialProperty": "true", }, }, { Name: "name", Type: model.ResourceProperty_STRING, Length: 255, Required: true, Unique: true, Immutable: true, }, { Name: "language", Type: model.ResourceProperty_ENUM, Required: true, EnumValues: []string{"PYTHON", "JAVASCRIPT"}, }, { Name: "content", Type: model.ResourceProperty_STRING, Length: 64000, Required: true, Annotations: map[string]string{ "SQLType": "TEXT", }, }, { Name: "contentFormat", Type: model.ResourceProperty_ENUM, Required: true, DefaultValue: structpb.NewStringValue("TEXT"), EnumValues: []string{"TEXT", "TAR", "TAR_GZ"}, }, { Name: "annotations", Type: model.ResourceProperty_MAP, Item: &model.ResourceProperty{ Name: "", Type: model.ResourceProperty_STRING, }, }, { Name: "version", Type: model.ResourceProperty_INT32, Required: true, DefaultValue: structpb.NewNumberValue(1), ExampleValue: structpb.NewNumberValue(1), Annotations: map[string]string{ "SpecialProperty": "true", "AllowEmptyPrimitive": "true", }, }, { Name: "auditData", Type: model.ResourceProperty_STRUCT, TypeRef: util.Pointer("AuditData"), ExampleValue: structpb.NewStructValue(&structpb.Struct{Fields: map[string]*structpb.Value{"createdBy": structpb.NewStringValue("admin"), "updatedBy": structpb.NewStringValue("admin"), "createdOn": structpb.NewStringValue("2024-03-28T17:16:51+04:00"), "updatedOn": structpb.NewStringValue("2024-03-28T17:16:51+04:00")}}), Annotations: map[string]string{ "SpecialProperty": "true", }, }, }, Annotations: map[string]string{ "EnableAudit": "true", "OpenApiGroup": "meta", "NormalizedResource": "true", }, }
Functions ¶
func GetBuiltinJs ¶ added in v1.3.28
Types ¶
type Code ¶
type Code struct { Id *uuid.UUID `json:"id,omitempty"` Name string `json:"name,omitempty"` Language CodeLanguage `json:"language,omitempty"` Content string `json:"content,omitempty"` ContentFormat CodeContentFormat `json:"contentFormat,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Version int32 `json:"version,omitempty"` AuditData *CodeAuditData `json:"auditData,omitempty"` }
func (*Code) GetAnnotations ¶
func (*Code) GetAuditData ¶
func (s *Code) GetAuditData() *CodeAuditData
func (*Code) GetContent ¶
func (*Code) GetContentFormat ¶
func (s *Code) GetContentFormat() CodeContentFormat
func (*Code) GetLanguage ¶
func (s *Code) GetLanguage() CodeLanguage
func (*Code) GetVersion ¶
type CodeAuditData ¶
type CodeAuditData struct { CreatedBy *string `json:"createdBy,omitempty"` UpdatedBy *string `json:"updatedBy,omitempty"` CreatedOn *time.Time `json:"createdOn,omitempty"` UpdatedOn *time.Time `json:"updatedOn,omitempty"` }
func (*CodeAuditData) GetCreatedBy ¶
func (s *CodeAuditData) GetCreatedBy() *string
func (*CodeAuditData) GetCreatedOn ¶
func (s *CodeAuditData) GetCreatedOn() *time.Time
func (*CodeAuditData) GetUpdatedBy ¶
func (s *CodeAuditData) GetUpdatedBy() *string
func (*CodeAuditData) GetUpdatedOn ¶
func (s *CodeAuditData) GetUpdatedOn() *time.Time
type CodeAuditDataMapper ¶
type CodeAuditDataMapper struct { }
func NewCodeAuditDataMapper ¶
func NewCodeAuditDataMapper() *CodeAuditDataMapper
func (*CodeAuditDataMapper) FromProperties ¶
func (m *CodeAuditDataMapper) FromProperties(properties map[string]*structpb.Value) *CodeAuditData
func (*CodeAuditDataMapper) New ¶
func (m *CodeAuditDataMapper) New() *CodeAuditData
func (*CodeAuditDataMapper) ResourceIdentity ¶
func (m *CodeAuditDataMapper) ResourceIdentity() abs.ResourceIdentity
func (*CodeAuditDataMapper) ToProperties ¶
func (m *CodeAuditDataMapper) ToProperties(codeAuditData *CodeAuditData) map[string]*structpb.Value
func (*CodeAuditDataMapper) ToUnstructured ¶ added in v1.3.43
func (m *CodeAuditDataMapper) ToUnstructured(codeAuditData *CodeAuditData) unstructured.Unstructured
type CodeContentFormat ¶
type CodeContentFormat string
const ( CodeContentFormat_TEXT CodeContentFormat = "TEXT" CodeContentFormat_TAR CodeContentFormat = "TAR" CodeContentFormat_TARGZ CodeContentFormat = "TAR_GZ" )
type CodeLanguage ¶
type CodeLanguage string
const ( CodeLanguage_PYTHON CodeLanguage = "PYTHON" CodeLanguage_JAVASCRIPT CodeLanguage = "JAVASCRIPT" )
type CodeMapper ¶
type CodeMapper struct { }
func NewCodeMapper ¶
func NewCodeMapper() *CodeMapper
func (*CodeMapper) FromProperties ¶
func (m *CodeMapper) FromProperties(properties map[string]*structpb.Value) *Code
func (*CodeMapper) FromRecord ¶
func (m *CodeMapper) FromRecord(record *model.Record) *Code
func (*CodeMapper) New ¶
func (m *CodeMapper) New() *Code
func (*CodeMapper) ResourceIdentity ¶
func (m *CodeMapper) ResourceIdentity() abs.ResourceIdentity
func (*CodeMapper) ToProperties ¶
func (m *CodeMapper) ToProperties(code *Code) map[string]*structpb.Value
func (*CodeMapper) ToUnstructured ¶ added in v1.3.43
func (m *CodeMapper) ToUnstructured(code *Code) unstructured.Unstructured
Source Files ¶
Click to show internal directories.
Click to hide internal directories.