repox

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPrint

type BPrint struct {
	Name        string   `json:"name,omitempty"`
	Slug        string   `json:"slug,omitempty"`
	Type        string   `json:"type,omitempty"`
	SubType     string   `json:"sub_type,omitempty"`
	Description string   `json:"description,omitempty"`
	Icon        string   `json:"icon,omitempty"`
	Versions    []string `json:"versions,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

type Builder

type Builder func(opts *BuilderOptions) (Repository, error)

type BuilderOptions

type BuilderOptions struct {
	TenantId  string
	BasePath  string
	ExtraMeta map[string]string
}

type Hub

type Hub interface {
	Start() error

	RepoCore
	RepoBprintOps

	GetInstancerHubV1() InstancerHubV1

	GetInstancerHubV2() InstancerHubV2
}

type InstanceOptionsV1

type InstanceOptionsV1 struct {
	BprintId       string             `json:"bprint_id,omitempty"`
	InstancerType  string             `json:"instancer_type,omitempty"`
	File           string             `json:"file,omitempty"`
	UserConfigData []byte             `json:"data,omitempty"`
	Auto           bool               `json:"auto,omitempty"`
	UserContext    *claim.UserContext `json:"-"`
}

type InstanceOptionsV2

type InstanceOptionsV2 struct {
	BprintId    string             `json:"bprint_id,omitempty"`
	UserSession *claim.UserContext `json:"-"`
	InstanceId  string             `json:"instance_id,omitempty"`
}

type InstanceResponseV2

type InstanceResponseV2 struct {
	Items map[string]string `json:"items,omitempty"`
}

type InstanceSheetOptions

type InstanceSheetOptions struct {
	Source      string                 `json:"source,omitempty"`
	Group       string                 `json:"group,omitempty"`
	Template    *xbprint.NewSheetGroup `json:"template,omitempty"`
	UserContext *claim.UserContext     `json:"-"`
}

type InstancerHubV1

type InstancerHubV1 interface {
	Instance(opts InstanceOptionsV1) (any, error)
	InstanceSheetDirect(opts InstanceSheetOptions) (*xinstance.Response, error)
}

type InstancerHubV2

type InstancerHubV2 interface {
	Instance(opts InstanceOptionsV2) (*InstanceResponseV2, error)
	Upgrade(opts UpdateOptionsV2) error

	InstanceSheetDirect(opts InstanceSheetOptions) (*xinstance.Response, error)
}

type RepoBprintOps

type RepoBprintOps interface {
	BprintList(tenantid, group string) ([]*entities.BPrint, error)
	BprintCreate(tenantid string, bp *entities.BPrint) (string, error)
	BprintUpdate(tenantid string, bp *entities.BPrint) error
	BprintGet(tenantid, bid string) (*entities.BPrint, error)
	BprintRemove(tenantid, bid string) error
	BprintListBlobs(tenantid, bid string) (map[string]string, error)

	BprintNewBlob(tenantid, bid, file string, payload []byte, updateList bool) error
	BprintUpdateBlob(tenantid, bid, file string, payload []byte) error
	BprintUpdateFilesList(tenantid, bid string, files ...string) error
	BprintGetBlob(tenantid, bid, file string) ([]byte, error)
	BprintDeleteBlob(tenantid, bid, file string) error
}

type RepoCore

type RepoCore interface {
	RepoSources(tenantid string) (map[int64]string, error)

	RepoSourceImport(tenantid string, opts *RepoImportOpts) (string, error)
	RepoSourceList(tenantid, group string, source int64, tags ...string) ([]BPrint, error)
	RepoSourceGet(tenantid, slug string, source int64) (*BPrint, error)
	RepoSourceGetZip(tenantid string, source int64, slug, version string) (io.ReadCloser, error)

	BprintCreateFromZip(tenantId string, rawreader io.ReadCloser) (string, error)
}

type RepoImportOpts

type RepoImportOpts struct {
	Slug    string `json:"slug,omitempty"`
	Group   string `json:"group,omitempty"`
	Source  int64  `json:"source,omitempty"`
	Version string `json:"version,omitempty"`
	NewId   string `json:"new_id,omitempty"`
}

type RepoQuery

type RepoQuery struct {
	Group string
	Tags  []string
	Page  int64
}

type Repository

type Repository interface {
	Name() string
	Query(tenantId string, opts *RepoQuery) ([]BPrint, error)

	Get(tenantid, slug string) (*BPrint, error)
	GetZip(tenantid, slug, version string) (io.ReadCloser, error)
}

type UpdateOptionsV2

type UpdateOptionsV2 struct {
	BprintId    string             `json:"bprint_id,omitempty"`
	Items       map[string]string  `json:"items,omitempty"`
	InstanceId  string             `json:"instance_id,omitempty"`
	UserSession *claim.UserContext `json:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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