initial commit

This commit is contained in:
Serge Zaitsev
2018-09-19 11:20:09 +02:00
parent 95a937ef2c
commit ce767e10ee
11 changed files with 918 additions and 1 deletions

25
pkg/store/store.go Normal file
View File

@@ -0,0 +1,25 @@
package store
import (
"context"
"time"
"github.com/sixt/gomodproxy/pkg/vcs"
)
type Store interface {
Put(ctx context.Context, snapshot Snapshot) error
Get(ctx context.Context, module string, version vcs.Version) (Snapshot, error)
Close() error
}
type Snapshot struct {
Module string
Version vcs.Version
Timestamp time.Time
Data []byte
}
func (s Snapshot) Key() string {
return s.Module + "@" + string(s.Version)
}