From d410c2d3d3982ef260382c13e10b2195b02a7b46 Mon Sep 17 00:00:00 2001 From: pb Date: Fri, 5 Jul 2024 14:45:08 +0200 Subject: [PATCH] restructuring --- models/template_models.go | 40 +++++++++++++++++++++++++++++++++++++++ models/volume_models.go | 19 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 models/template_models.go create mode 100644 models/volume_models.go diff --git a/models/template_models.go b/models/template_models.go new file mode 100644 index 0000000..03a2d7d --- /dev/null +++ b/models/template_models.go @@ -0,0 +1,40 @@ +package main + +type Parameter struct { + Name string `yaml:"name,omitempty"` + Value string `yaml:"value,omitempty"` +} + +type Container struct { + Image string `yaml:"image"` + Command []string `yaml:"command,omitempty,flow"` + Args []string `yaml:"args,omitempty,flow"` + VolumeMounts []VolumeMount `yaml:"volumeMounts,omitempty"` +} + +type VolumeMount struct { + Name string `yaml:"name"` + MountPath string `yaml:"mountPath"` +} + +type Task struct { + Name string `yaml:"name"` + Template string `yaml:"template"` + Dependencies []string `yaml:"dependencies,omitempty"` + Arguments struct { + Parameters []Parameter `yaml:"parameters,omitempty"` + } `yaml:"arguments,omitempty"` +} + +type Dag struct { + Tasks []Task `yaml:"tasks,omitempty"` +} + +type Template struct { + Name string `yaml:"name"` + Inputs struct { + Parameters []Parameter `yaml:"parameters"` + } `yaml:"inputs,omitempty"` + Container Container `yaml:"container,omitempty"` + Dag Dag `yaml:"dag,omitempty"` +} diff --git a/models/volume_models.go b/models/volume_models.go new file mode 100644 index 0000000..8396ada --- /dev/null +++ b/models/volume_models.go @@ -0,0 +1,19 @@ +package main + + + +type VolumeClaimTemplate struct { + Metadata struct { + Name string `yaml:"name"` + } `yaml:"metadata"` + Spec VolumeSpec `yaml:"spec"` +} + +type VolumeSpec struct { + AccessModes []string `yaml:"accessModes,flow"` + Resources struct { + Requests struct { + Storage string `yaml:"storage"` + } `yaml:"requests"` + } `yaml:"resources"` +} \ No newline at end of file