parser

package
v0.0.0-...-f684c1c Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileList

type FileList struct {
	Name     string     `json:"name"`
	Type     string     `json:"type"`
	Size     int64      `json:"size,omitempty"`
	Children []FileList `json:"children,omitempty"`
}

type FileNode

type FileNode struct {
	Name     string
	Type     FileType
	Size     int64
	Children map[string]*FileNode
	// contains filtered or unexported fields
}

func NewDirectory

func NewDirectory(name string) *FileNode

func NewFile

func NewFile(name string, size int64) *FileNode

func (*FileNode) AddChild

func (root *FileNode) AddChild(child *FileNode) error

func (*FileNode) AddNode

func (root *FileNode) AddNode(path string, size int64, isDir bool) (*FileNode, error)

func (*FileNode) GetChild

func (root *FileNode) GetChild(name string) (*FileNode, bool)

type FileType

type FileType = string

FileType represents the type of a file.

const (
	TypeFile      FileType = "file"
	TypeDirectory FileType = "directory"
)

type Parser

type Parser interface {
	// Parse returns the parsed content type and content.
	Parse(ctx context.Context, artifact *artifact.Artifact, manifest *ocispec.Manifest) (contentType string, content []byte, err error)
}

Parser is the interface for parsing the content by different addition type.

func NewFiles

func NewFiles(cli registry.Client) Parser

NewFiles creates a new files parser.

func NewLicense

func NewLicense(cli registry.Client) Parser

NewLicense creates a new license parser.

func NewReadme

func NewReadme(cli registry.Client) Parser

NewReadme creates a new readme parser.

Jump to

Keyboard shortcuts

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