Пример #1
0
func newCoreRepoImpl() repo {
	return snappy.NewSystemImageRepository()
}
Пример #2
0
	return SyncResponse(m)
}

type metarepo interface {
	Details(string, string) ([]snappy.Part, error)
	All() ([]snappy.Part, error)
	Updates() ([]snappy.Part, error)
}

var newRemoteRepo = func() metarepo {
	return snappy.NewMetaStoreRepository()
}

var newSystemRepo = func() metarepo {
	return snappy.NewSystemImageRepository()
}

var muxVars = mux.Vars

func getPackageInfo(c *Command, r *http.Request) Response {
	vars := muxVars(r)
	name := vars["name"]
	origin := vars["origin"]

	repo := newRemoteRepo()
	var part snappy.Part
	if parts, _ := repo.Details(name, origin); len(parts) > 0 {
		part = parts[0]
	}