code

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const BindingFilePath = "leap_mapping.yaml"

Variables

View Source
var CodeIntegrationEntityDesc = entity.NewEntityDescriptor[CodeIntegration](
	"code integration",
	"code integrations",
	func(p *CodeIntegration) string { return p.GetName() },
	func(p *CodeIntegration) string { return p.GetCid() },
)
View Source
var CodeIntegrationVersionEntityDesc = entity.NewEntityDescriptor[CodeIntegrationVersion](
	"code integration version",
	"code integration versions",
	func(p *CodeIntegrationVersion) string { return p.GetNote() },
	func(p *CodeIntegrationVersion) string { return p.GetCid() },
)
View Source
var ErrEmptyCodeIntegrationVersion = fmt.Errorf("CodeIntegration is empty")

Functions

func AskForCodeIntegrationName

func AskForCodeIntegrationName(codeIntegrations []CodeIntegration) (name string, err error)

func AskForCodeIntegrationNameIfExisted added in v0.0.84

func AskForCodeIntegrationNameIfExisted(name string, codeIntegrations []CodeIntegration) (string, error)

func BranchesFromCodeIntegration added in v0.0.84

func BranchesFromCodeIntegration(codeIntegration *CodeIntegration) []string

func BundleCodeIntoTempFile added in v0.0.20

func BundleCodeIntoTempFile(filesDir string, workspaceConfig *workspace.WorkspaceConfig) (close func(), tarGzFile *os.File, err error)

func CloneCodeIntegrationVersion

func CloneCodeIntegrationVersion(ctx context.Context, codeIntegrationVersion *tensorleapapi.DatasetVersion, outputDir string) ([]string, error)

func CompareCodeVersion added in v0.0.23

func CompareCodeVersion(ctx context.Context, compareVersion *CodeIntegrationVersion, tarGzFile *os.File, entryFile, secretId string) (bool, error)

func CreateOrSelectBranch added in v0.0.84

func CreateOrSelectBranch(branch string, branches []string, defaultBranch string) (selectedBranch string, err error)

func DeleteCodeIntegration added in v0.0.20

func DeleteCodeIntegration(ctx context.Context, codeIntegration *CodeIntegration) error

func FetchFileFromTarGz added in v0.0.26

func FetchFileFromTarGz(blobURL string, filename string) (string, error)

func GetDatasetMappingYaml added in v0.0.26

func GetDatasetMappingYaml(ctx context.Context, codeIntegrationId, branch string) string

func GetLatestVersion

func GetLatestVersion(ctx context.Context, codeIntegrationId string, branch string) (*tensorleapapi.DatasetVersion, error)

func IsCodeParseFailed added in v0.0.23

func IsCodeParseFailed(codeIntegrationVersion *CodeIntegrationVersion) bool

func IsCodeParsing added in v0.0.23

func IsCodeParsing(codeIntegrationVersion *CodeIntegrationVersion) bool

func PrintCodeIntegrationVersionParserErr added in v0.0.22

func PrintCodeIntegrationVersionParserErr(civ *CodeIntegrationVersion)

func SelectBranch added in v0.0.84

func SelectBranch(branches []string, defaultBranch string) (selectedBranch string, err error)

func SelectOrCreateCodeIntegration added in v0.0.20

func SelectOrCreateCodeIntegration(ctx context.Context, codeIntegrations []CodeIntegration, askIsCreateNewFirst bool) (*tensorleapapi.Dataset, bool, error)

func SyncBranchFromFlagAndConfig added in v0.0.84

func SyncBranchFromFlagAndConfig(flagBranch string, workspaceConfig *workspace.WorkspaceConfig, branches []string, defaultBranch string) (string, error)

Types

type CodeIntegration added in v0.0.20

type CodeIntegration = tensorleapapi.Dataset

func AddCodeIntegration added in v0.0.20

func AddCodeIntegration(ctx context.Context, name string) (*CodeIntegration, error)

func CreateCodeIntegration added in v0.0.20

func CreateCodeIntegration(ctx context.Context, codeIntegrations []CodeIntegration) (*CodeIntegration, error)

func GetAndUpdateCodeIntegrationIfNotExists added in v0.0.20

func GetAndUpdateCodeIntegrationIfNotExists(ctx context.Context, workspaceConfig *workspace.WorkspaceConfig) (code *CodeIntegration, wasCreated bool, err error)

func GetCodeIntegrationFromFlag added in v0.0.20

func GetCodeIntegrationFromFlag(ctx context.Context, codeIntegrationIdFlag string, askForNewProjectFirst bool) (code *CodeIntegration, wasCreated bool, err error)

func GetCodeIntegrations added in v0.0.20

func GetCodeIntegrations(ctx context.Context) ([]CodeIntegration, error)

type CodeIntegrationVersion added in v0.0.20

type CodeIntegrationVersion = tensorleapapi.DatasetVersion

func AddCodeIntegrationVersion added in v0.0.20

func AddCodeIntegrationVersion(ctx context.Context, tarGzFile io.Reader, fileSize int64, codeIntegrationId, entryFile, secretId, branch string) (*CodeIntegrationVersion, error)

func GetCodeIntegration added in v0.0.22

func GetCodeIntegration(ctx context.Context, id string) (*CodeIntegrationVersion, error)

func GetCodeIntegrationVersions added in v0.0.20

func GetCodeIntegrationVersions(ctx context.Context, codeIntegrationId string) ([]CodeIntegrationVersion, error)

func PushCode added in v0.0.23

func PushCode(ctx context.Context, force bool, codeIntegrationId string, tarGzFile *os.File, entryFile, secretId, branch string) (pushed bool, current *CodeIntegrationVersion, err error)

func WaitForCodeIntegrationStatus added in v0.0.22

func WaitForCodeIntegrationStatus(ctx context.Context, codeIntegrationId string) (ok bool, codeIntegrationVersion *CodeIntegrationVersion, err error)

Jump to

Keyboard shortcuts

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