Documentation
¶
Overview ¶
Package codemeta reads and validates CodeMeta metadata offline.
Index ¶
- Variables
- type Agent
- func (a Agent) Agents() []Agent
- func (a Agent) FamilyName() string
- func (a Agent) Get(term string) Value
- func (a Agent) GivenName() string
- func (a Agent) Identifier() Value
- func (a Agent) Kind() AgentKind
- func (a Agent) Name() string
- func (a Agent) RoleName() Value
- func (a Agent) Strings(term string) []string
- func (a Agent) Value() Value
- type AgentKind
- type Diagnostic
- type Document
- func (d *Document) Author() []Agent
- func (d *Document) CodeRepository() Value
- func (d *Document) Contributor() []Agent
- func (d *Document) CopyrightHolder() []Agent
- func (d *Document) DateModified() Value
- func (d *Document) DatePublished() Value
- func (d *Document) Description() string
- func (d *Document) DevelopmentStatus() Value
- func (d *Document) Fields() []Field
- func (d *Document) Funder() []Agent
- func (d *Document) Get(name string) Value
- func (d *Document) Identifier() Value
- func (d *Document) Keywords() Value
- func (d *Document) License() Value
- func (d *Document) Maintainer() []Agent
- func (d *Document) Name() string
- func (d *Document) ProgrammingLanguages() Value
- func (d *Document) SoftwareVersion() Value
- func (d *Document) Strings(term string) []string
- func (d *Document) Validate() []Diagnostic
- func (d *Document) Version() Version
- type Error
- type Field
- type Kind
- type ParseOptions
- type Position
- type Value
- type Version
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is an immutable view. Value retains the original object or scalar.
func (Agent) FamilyName ¶
func (Agent) Identifier ¶
type AgentKind ¶
type AgentKind uint8
AgentKind describes the retained form, including conflicting person fields.
type Diagnostic ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func ParseWithOptions ¶
func ParseWithOptions(data []byte, opts ParseOptions) (*Document, error)
func Read ¶
func Read(r io.Reader, opts ParseOptions) (*Document, error)
Read leaves r open and consumes at most MaxBytes+1 bytes.
func ReadFile ¶
func ReadFile(path string, opts ParseOptions) (*Document, error)
ReadFile owns and closes the opened file.
func (*Document) CodeRepository ¶
func (*Document) Contributor ¶
func (*Document) CopyrightHolder ¶
func (*Document) DateModified ¶
func (*Document) DatePublished ¶
func (*Document) Description ¶
func (*Document) DevelopmentStatus ¶
func (*Document) Identifier ¶
func (*Document) Maintainer ¶
func (*Document) ProgrammingLanguages ¶
func (*Document) SoftwareVersion ¶
func (*Document) Strings ¶ added in v0.2.0
Strings projects a term's scalar spelling, object identifiers, or object names in source order. It unwraps JSON-LD lists, sets, and value objects and resolves keys using each object's context. Empty strings and nulls are skipped. The original values remain available through Get.
func (*Document) Validate ¶
func (d *Document) Validate() []Diagnostic
Validate returns diagnostics in source order, capped including a truncation entry.
type Error ¶
type Error struct {
Diagnostic
Category error
Cause error
}
Error retains a machine-readable category and the original I/O error, if any.
type ParseOptions ¶
type ParseOptions struct {
MaxBytes int64
MaxDepth int
MaxNodes int
MaxStringBytes int
MaxDiagnostics int
}
ParseOptions bounds untrusted input. Zero selects the documented defaults. MaxBytes must be less than math.MaxInt64 to allow one extra byte for limit detection.
type Position ¶
Position identifies a one-based Unicode character line and column. Zero means no source position is available.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
read
command
Command read demonstrates reading metadata from a file or standard input.
|
Command read demonstrates reading metadata from a file or standard input. |
|
internal
|
|
|
generate
command
Command generate compiles the pinned contexts and property descriptions.
|
Command generate compiles the pinned contexts and property descriptions. |