Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemRepoStore ¶
type MemRepoStore struct {
// contains filtered or unexported fields
}
MemRepoStore is a memory based repo datastore
func NewMemRepoStore ¶
func NewMemRepoStore() *MemRepoStore
NewMemRepoStore instantiates a new repo store
func (*MemRepoStore) CreateRepo ¶
func (mrs *MemRepoStore) CreateRepo(repo *Repository) error
CreateRepo with the given repo data
func (*MemRepoStore) GetRepo ¶
func (mrs *MemRepoStore) GetRepo(id string) (*Repository, error)
GetRepo with the given id
func (*MemRepoStore) RemoveRepo ¶
func (mrs *MemRepoStore) RemoveRepo(id string) error
RemoveRepo with the given id
func (*MemRepoStore) UpdateRepo ¶
func (mrs *MemRepoStore) UpdateRepo(repo *Repository) error
UpdateRepo with the given data
type Repository ¶
type Repository struct { ID string `json:"id"` Refs *RepositoryReferences `json:"refs"` }
Repository represents a single repo.
func NewRepository ¶
func NewRepository(id string) *Repository
NewRepository instantiates an empty repo.
func (*Repository) String ¶
func (repo *Repository) String() string
type RepositoryHead ¶
RepositoryHead contains the HEAD ref and hash information
type RepositoryReferences ¶
type RepositoryReferences struct { // TODO: Although head is exposed it should be be used directly when setting its // value. It is only here to until a msgpack marshaller is implemented. Head RepositoryHead Heads map[string]plumbing.Hash Tags map[string]plumbing.Hash // contains filtered or unexported fields }
RepositoryReferences contains repo refs and head information.
func NewRepositoryReferences ¶
func NewRepositoryReferences() *RepositoryReferences
NewRepositoryReferences instantiates a new RepositoryReferences structure with the defaults.
func (*RepositoryReferences) MarshalJSON ¶
func (refs *RepositoryReferences) MarshalJSON() ([]byte, error)
MarshalJSON is a custom json marshaller for the repository specifically to handle hashes.
type RepositoryStore ¶
type RepositoryStore interface { GetRepo(string) (*Repository, error) CreateRepo(*Repository) error UpdateRepo(*Repository) error RemoveRepo(string) error }
RepositoryStore is the repository storage interface that should be implemented.