mediatype

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArtifactTypeKitManifest   = "application/vnd.kitops.modelkit.manifest.v1+json"
	ArtifactTypeModelManifest = "application/vnd.cncf.model.manifest.v1+json"
)

Variables

This section is empty.

Functions

func FormatMediaTypeForUser

func FormatMediaTypeForUser(mediatype string) string

func IsValidCompression

func IsValidCompression(c string) error

Types

type BaseType

type BaseType int
const (
	UnknownBaseType BaseType = iota
	// ConfigBaseType is the base type for model configs
	ConfigBaseType
	// ModelBaseType is the base type for primary model files
	ModelBaseType
	// ModelPartBaseType is the base type for model-related files. In ModelPack formats, it is
	// reused for the `model.config` type
	ModelPartBaseType
	// DatasetBaseType is the base type for dataset layers
	DatasetBaseType
	// CodeBaseType is the base type for code layers
	CodeBaseType
	// DocsBaseType is the base type for documentation layers
	DocsBaseType
)

func ParseKitBaseType

func ParseKitBaseType(s string) (BaseType, error)

func ParseModelPackBaseType

func ParseModelPackBaseType(s string) (BaseType, error)

type CompressionType

type CompressionType int
const (
	UnknownCompression CompressionType = iota
	NoneCompression
	GzipCompression
	GzipFastestCompression
	ZstdCompression
)

func ParseCompression

func ParseCompression(c string) (CompressionType, error)

func (CompressionType) String

func (c CompressionType) String() string

type Format

type Format int
const (
	UnknownFormat Format = iota
	TarFormat
	RawFormat
)

func ParseFormat

func ParseFormat(f string) (Format, error)

type MediaType

type MediaType interface {
	Base() BaseType
	Compression() CompressionType
	Format() Format
	String() string
	UserString() string
}
var KitConfigMediaType MediaType = &kitopsMediaType{
	baseType: ConfigBaseType,
}
var ModelPackConfigMediaType MediaType = &modelpackMediatype{
	baseType: ConfigBaseType,
}

func New

func New(modelFormat ModelFormat, base BaseType, format Format, comp CompressionType) MediaType

func ParseMediaType

func ParseMediaType(s string) (MediaType, error)

type ModelFormat

type ModelFormat int
const (
	UnknownModelFormat ModelFormat = iota
	KitFormat
	ModelPackFormat
)

func ModelFormatForManifest

func ModelFormatForManifest(manifest *ocispec.Manifest) (ModelFormat, error)

Jump to

Keyboard shortcuts

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