-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8a91c4
commit af5042d
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) 2024 Jared Allard | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
// TODO(jaredallard): This probably should implement a "store" for also | ||
// storing the packages themselves. Maybe S3 or something else backed? | ||
|
||
// Package db implements a thin wrapper around a DB for the purpose of | ||
// storing package information. | ||
package db | ||
|
||
// Client contains a DB client. | ||
type Client struct{} | ||
|
||
// New creates a new DB client. | ||
func New() (*Client, error) { return nil, nil } | ||
|
||
// TODO(jaredallard): package struct from somewhere? | ||
// NewPackage creates a new package and stores it. | ||
func (c *Client) NewPackage() error { return nil } | ||
|
||
func (c *Client) DeletePackage(id string) error { return nil } | ||
|
||
func (c *Client) CreateTarget(name string) error { return nil } | ||
|
||
func (p *Client) DeleteTarget(name string) error { return nil } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (C) 2024 Jared Allard | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
// Packages contains utilities for interacting with Gentoo packages. | ||
package packages | ||
|
||
import ( | ||
"archive/tar" | ||
"io" | ||
) | ||
|
||
type Package struct { | ||
// TODO(jaredallard): Add fields for a package here. | ||
} | ||
|
||
// New creates a new Package from the provided [io.ReadCloser]. | ||
func New(r io.ReadCloser) (*Package, error) { | ||
var p Package | ||
|
||
t := tar.NewReader(r) | ||
|
||
// TODO(jaredallard): Once we have internet, we should actually do | ||
// something with the tar reader. | ||
_ = t | ||
return &p, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (C) 2024 Jared Allard | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
// Package server contains the code for creating an HTTP server for | ||
// serving a binhost. | ||
package server | ||
|
||
import "context" | ||
|
||
type Activity struct{} | ||
|
||
// Run starts the HTTP service activity. Blocks until the provided | ||
// context is cancelled. | ||
func (a *Activity) Run(_ context.Context) error { | ||
return nil | ||
} |