libraries

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: BSD-3-Clause Imports: 7 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 Branch

func Branch(value string) basic.Op

func Description

func Description(value string) basic.Op

func Github

func Github(id string, fullname string) basic.Op

func Id

func Id(value string) basic.Op

func Path

func Path(value string) basic.Op

func SmartOps

func SmartOps(value []string) basic.Op

func Tags

func Tags(value []string) basic.Op

Types

type Getter

type Getter interface {
	basic.ResourceGetter[*structureSpec.Library]
	Path() string
	Branch() string
	Git() (provider, id, fullname string)
}

func Yaml

func Yaml(name, application string, yamlData []byte) (Getter, error)

type Library

type Library interface {
	Get() Getter
	common.Resource[*structureSpec.Library]
}
Example
package main

import (
	"fmt"

	"github.com/spf13/afero"
	"github.com/taubyte/tau/pkg/schema/libraries"
	"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 library
	lib, err := project.Library("test_lib", "")
	if err != nil {
		return
	}

	// Set and write library fields
	err = lib.Set(true,
		libraries.Id("QmaEBKzOyrYL1D6gtqD86Nyr2hvXAxWHcMCu9ffxLaByMc"),
		libraries.Description("a basic library"),
		libraries.Tags([]string{"tag1", "tag2"}),
		libraries.Path("/src"),
		libraries.Branch("main"),
		libraries.Github("222222222", "taubyte-test/library2"),
	)
	if err != nil {
		return
	}

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

	// Open the config.yaml of the library
	config, err := afero.ReadFile(fs, "/libraries/test_lib.yaml")
	if err != nil {
		return
	}

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

}
Output:
a basic library
id: QmaEBKzOyrYL1D6gtqD86Nyr2hvXAxWHcMCu9ffxLaByMc
description: a basic library
tags:
    - tag1
    - tag2
source:
    path: /src
    branch: main
    github:
        id: "222222222"
        fullname: taubyte-test/library2

func Open

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

Jump to

Keyboard shortcuts

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