Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 7, 2023
1 parent b735a78 commit d11b3cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions dewy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
starter "github.com/lestrrat-go/server-starter"
"github.com/linyows/dewy/kvs"
"github.com/linyows/dewy/notice"
"github.com/linyows/dewy/registory"
"github.com/linyows/dewy/registry"

Check failure on line 21 in dewy.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

no required module provides package github.com/linyows/dewy/registry; to add it:

Check failure on line 21 in dewy.go

View workflow job for this annotation

GitHub Actions / Unit test

no required module provides package github.com/linyows/dewy/registry; to add it:
"github.com/linyows/dewy/repo"
"github.com/linyows/dewy/storage"
)
Expand All @@ -33,7 +33,7 @@ const (
// Dewy struct.
type Dewy struct {
config Config
registory registory.Registory
registry registry.Registry
cache kvs.KVS
isServerRunning bool
root string
Expand All @@ -60,7 +60,7 @@ func New(c Config) (*Dewy, error) {
return &Dewy{
config: c,
cache: kv,
registory: r,
registry: r,
isServerRunning: false,
root: wd,
}, nil
Expand All @@ -78,7 +78,7 @@ func (d *Dewy) Start(i int) {
Source: d.config.Repository.Artifact,
Command: d.config.Command.String(),
}
repo, ok := d.registory.(*repo.GithubRelease)
repo, ok := d.registry.(*repo.GithubRelease)
if ok {
nc.OwnerLink = repo.OwnerURL()
nc.OwnerIcon = repo.OwnerIconURL()
Expand Down Expand Up @@ -122,7 +122,7 @@ func (d *Dewy) Run() error {
defer cancel()

// Get current
res, err := d.registory.Current(&registory.CurrentRequest{
res, err := d.registry.Current(&registry.CurrentRequest{
Arch: runtime.GOARCH,
OS: runtime.GOOS,
ArtifactName: d.config.Repository.Artifact,
Expand Down Expand Up @@ -190,7 +190,7 @@ func (d *Dewy) Run() error {
}

log.Print("[DEBUG] Record shipping")
err = d.registory.Report(&registory.ReportRequest{
err = d.registry.Report(&registry.ReportRequest{
ID: res.ID,
Tag: res.Tag,
})
Expand Down
2 changes: 1 addition & 1 deletion dewy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestNew(t *testing.T) {
}
expect := &Dewy{
config: c,
registory: r,
registry: r,
cache: dewy.cache,
isServerRunning: false,
root: wd,
Expand Down
4 changes: 2 additions & 2 deletions registory/registory.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package registory
package registry

type Registory interface {
type Registry interface {
// Current returns the current artifact.
Current(*CurrentRequest) (*CurrentResponse, error)
// Report reports the result of deploying the artifact.
Expand Down
10 changes: 5 additions & 5 deletions repo/github_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/go-github/v55/github"
"github.com/google/go-querystring/query"
"github.com/k1LoW/go-github-client/v55/factory"
"github.com/linyows/dewy/registory"
"github.com/linyows/dewy/registry"
ghrelease "github.com/linyows/dewy/storage/github_release"
)

Expand All @@ -23,7 +23,7 @@ const (
ISO8601 = "20060102T150405Z0700"
)

var _ registory.Registory = (*GithubRelease)(nil)
var _ registry.Registry = (*GithubRelease)(nil)

// GithubRelease struct.
type GithubRelease struct {
Expand Down Expand Up @@ -86,7 +86,7 @@ func (g *GithubRelease) URL() string {
}

// Current returns current artifact.
func (g *GithubRelease) Current(req *registory.CurrentRequest) (*registory.CurrentResponse, error) {
func (g *GithubRelease) Current(req *registry.CurrentRequest) (*registry.CurrentResponse, error) {
release, err := g.latest()
if err != nil {
return nil, err
Expand Down Expand Up @@ -152,7 +152,7 @@ func (g *GithubRelease) Current(req *registory.CurrentRequest) (*registory.Curre

au := fmt.Sprintf("%s://%s/%s/tag/%s/%s", ghrelease.Scheme, g.owner, g.repo, release.GetTagName(), artifactName)

return &registory.CurrentResponse{
return &registry.CurrentResponse{
ID: time.Now().Format(ISO8601),
Tag: release.GetTagName(),
ArtifactURL: au,
Expand Down Expand Up @@ -183,7 +183,7 @@ func (g *GithubRelease) latest() (*github.RepositoryRelease, error) {
}

// Report report shipping.
func (g *GithubRelease) Report(req *registory.ReportRequest) error {
func (g *GithubRelease) Report(req *registry.ReportRequest) error {
if g.disableRecordShipping {
return nil
}
Expand Down

0 comments on commit d11b3cf

Please sign in to comment.