application

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Description

func Description(value string) basic.Op

func Id

func Id(value string) basic.Op

func Tags

func Tags(value []string) basic.Op

Types

type Application

type Application interface {
	Get() Getter
	Set(sync bool, ops ...basic.Op) (err error)
	Delete(attributes ...string) (err error)
	Prettify(p pretty.Prettier, resources []pretty.PrettyResourceIface) map[string]interface{}
}
Example
package main

import (
	"fmt"

	"github.com/spf13/afero"
	"github.com/taubyte/tau/pkg/schema/application"
	"github.com/taubyte/tau/pkg/schema/project"
)

func main() {
	// Create a new file system in memory
	fs := afero.NewMemMapFs()

	// Open a new project with a virtual file system
	project, err := project.Open(project.VirtualFS(fs, "/"))
	if err != nil {
		return
	}

	// Create or open an application
	app, err := project.Application("test_app")
	if err != nil {
		return
	}

	// Set and write application fields
	err = app.Set(true,
		application.Id("123456"),
		application.Description("this is an application"),
		application.Tags([]string{"tag1", "tag2"}),
	)
	if err != nil {
		return
	}

	// Display the Description
	fmt.Println(app.Get().Description())

	// Open the config.yaml of the application
	config, err := afero.ReadFile(fs, "/applications/test_app/config.yaml")
	if err != nil {
		return
	}

	// Print config.yaml
	fmt.Println(string(config))

}
Output:
this is an application
id: "123456"
description: this is an application
tags:
    - tag1
    - tag2

func Open

func Open(seer *seer.Seer, name string) (Application, error)

Open opens the application at root/applications/<name>, returns Application and error

type Getter

type Getter interface {
	basic.Getter
	Tags() []string
}

Getter is an abstraction for getting values from an application config

Jump to

Keyboard shortcuts

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