Documentation
¶
Overview ¶
Package models defines data structures used throughout ccmd.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Version string `json:"version"`
Source string `json:"source"`
InstalledAt time.Time `json:"installed_at"`
UpdatedAt time.Time `json:"updated_at"`
Dependencies []string `json:"dependencies,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Command represents an installed command in the lock file
type CommandMetadata ¶
type CommandMetadata struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
Description string `yaml:"description" json:"description"`
Author string `yaml:"author" json:"author"`
Repository string `yaml:"repository" json:"repository"`
Entry string `yaml:"entry,omitempty" json:"entry,omitempty"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"`
}
CommandMetadata represents the structure of a ccmd.yaml file
func (*CommandMetadata) MarshalJSON ¶
func (cm *CommandMetadata) MarshalJSON() ([]byte, error)
MarshalJSON marshals CommandMetadata to JSON
func (*CommandMetadata) MarshalYAML ¶
func (cm *CommandMetadata) MarshalYAML() ([]byte, error)
MarshalYAML marshals CommandMetadata to YAML
func (*CommandMetadata) UnmarshalJSON ¶
func (cm *CommandMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON data into CommandMetadata
func (*CommandMetadata) UnmarshalYAML ¶
func (cm *CommandMetadata) UnmarshalYAML(data []byte) error
UnmarshalYAML unmarshals YAML data into CommandMetadata
func (*CommandMetadata) Validate ¶
func (cm *CommandMetadata) Validate() error
Validate validates the command metadata
type LockFile ¶
type LockFile struct {
Version string `json:"version"`
Commands map[string]*Command `json:"commands"`
}
LockFile represents the commands.lock file structure
func (*LockFile) GetCommand ¶
GetCommand returns a command entry by name
func (*LockFile) RemoveCommand ¶
RemoveCommand removes a command from the lock file
func (*LockFile) SetCommand ¶
SetCommand sets or updates a command entry
Click to show internal directories.
Click to hide internal directories.