registry

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Register configs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	Projects    map[string]project.Project `json:"projects"`
	LastUpdated int64                      `json:"lastUpdated"`
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (project.Project, bool)

func (Registry) GetConfigFile

func (r Registry) GetConfigFile() string

GetConfigFile returns the config file path from the registry

func (*Registry) Index added in v0.4.0

func (r *Registry) Index() error

Index scan the homedir and add goproj compatible projects

func (*Registry) List

func (r *Registry) List() []string

func (*Registry) Load

func (r *Registry) Load() error

Load loads the registry data from the registry file

func (*Registry) Prune added in v0.4.0

func (r *Registry) Prune() error

Prune removes all non-existing projects from the registry

func (*Registry) Read

func (r *Registry) Read(reader io.Reader) error

Read reads the registry data from the registry file

func (*Registry) Register

func (r *Registry) Register(p project.Project)

func (*Registry) Remove

func (r *Registry) Remove(name string)

Remove removes a project from the registry data

reg := registry.NewRegistry()
reg.Remove("foo")

func (*Registry) Save

func (r *Registry) Save() error

Save saves the registry data to the registry file

func (*Registry) SetLastUpdated

func (r *Registry) SetLastUpdated()

SetLastUpdated sets the last updated time in the registry data

func (Registry) Write

func (r Registry) Write(writer io.Writer) error

Write writes the registry data to the registry file

func (Registry) WriteTable added in v0.4.0

func (r Registry) WriteTable(writer io.Writer)

Jump to

Keyboard shortcuts

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