Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templating 2.0 #192

Draft
wants to merge 8 commits into
base: modules
Choose a base branch
from
Draft

Templating 2.0 #192

wants to merge 8 commits into from

Conversation

huy-nodeset
Copy link
Contributor

No description provided.

Comment on lines 26 to 29
tmpl, err := template.New(filepath.Base(t.Src)).Funcs(template.FuncMap{
"GetValue": data.(*ServiceDataSource).GetValue,
"GetValueArray": data.(*ServiceDataSource).GetValueArray,
}).ParseFiles(t.Src)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need this. The datatype should already be able to handle this.

Dst string
}

func (t AdapterTemplate) Write(data interface{}) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be re-used with adapter/service


// Struct to pass into the template engine containing all necessary data and methods for populating a template.
type MetadataDataSource struct {
CustomFields map[string]string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need (TBD)


// Struct to pass into the template engine containing all necessary data and methods for populating a template.
type AdapterDataSource struct {
GetProjectName string
Copy link
Contributor Author

@huy-nodeset huy-nodeset Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func() not string. Comes from hyperdrive itself

Comment on lines 6 to 9
ModuleConfigDir string
ModuleSecretFile string
ModuleLogDir string
ModuleJwtKeyFile string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably will all be functions/methods.

Add Get to beginning and update spec

Comment on lines 11 to 14
ModuleConfigDir string
ModuleDataDir string
HyperdriveDaemonUrl string
HyperdriveJwtKeyFile string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant