From c51ca7c62e08f43ef9974af35886d30ce54a1f22 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 16 May 2024 20:22:42 +0200 Subject: refactor: use interface to unify Options and Packages --- internal/nix/package.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 internal/nix/package.go (limited to 'internal/nix/package.go') diff --git a/internal/nix/package.go b/internal/nix/package.go new file mode 100644 index 0000000..4158d1f --- /dev/null +++ b/internal/nix/package.go @@ -0,0 +1,41 @@ +package nix + +type Package struct { + Name string + Source string + Broken bool + Definition string + Description string + Homepages []string + Licenses []License + LongDescription string + MainProgram string + Maintainers []Maintainer + Platforms []string + Version string +} + +type License struct { + FullName string + Name string + SPDXId string + URL string + AppendixURL string +} + +type Maintainer struct { + Github string + Name string +} + +func (Package) BleveType() string { + return "package" +} + +func (p Package) GetName() string { + return p.Name +} + +func (p Package) GetSource() string { + return p.Source +} -- cgit 1.4.1