first compiling version

This commit is contained in:
ston1th 2023-03-15 01:51:45 +01:00
commit 3d54199faa
27 changed files with 908 additions and 243 deletions

View file

@ -54,17 +54,20 @@ type Key struct {
Created int64 `json:"created"`
Size int `json:"size"`
Encoding core.Encoding `json:"encoding"`
Key string `json:"key"`
Key string `json:"key,omitempty"`
}
type Keys []Key
func (Keys) Less(a, b Key) { return a.Name < b.Name }
func (k Keys) Sort() { slices.SortStableFunc(k, k.Less) }
func (Keys) Less(a, b Key) bool { return a.Name < b.Name }
func (k Keys) Sort() { slices.SortStableFunc(k, k.Less) }
func NewKeys(keys core.Keys) (k Keys) {
k = Keys(keys)
for _, key := range keys {
k = append(k, Key(key))
}
k.Sort()
return
}
type Approval struct {
@ -77,8 +80,8 @@ type Approval struct {
type Approvals []Approval
func (Approvals) Less(a, b Approval) { return a.Name < b.Name }
func (a Approvals) Sort() { slices.SortStableFunc(a, a.Less) }
func (Approvals) Less(a, b Approval) bool { return a.Name < b.Name }
func (a Approvals) Sort() { slices.SortStableFunc(a, a.Less) }
func NewApprovals(m types.ApprovalMap) (a Approvals) {
for k, v := range m {