Skip to content

Commit

Permalink
refactoring: moved kopia/kopia/policy to kopia/kopia/snapshot/policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowalski committed Oct 20, 2018
1 parent 123673b commit d47f662
Show file tree
Hide file tree
Showing 21 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
COVERAGE_PACKAGES=./repo/...,./fs/...,./snapshot/...

all: install install-examples test lint vet integration-tests

install:
Expand Down Expand Up @@ -52,7 +54,7 @@ dev-deps:
gometalinter.v2 --install

test-with-coverage: install
go test -count=1 -coverprofile=tmp.cov --coverpkg github.com/kopia/kopia/... -timeout 90s github.com/kopia/kopia/...
go test -count=1 -coverprofile=tmp.cov --coverpkg $(COVERAGE_PACKAGES) -timeout 90s github.com/kopia/kopia/...

test: install
go test -count=1 -timeout 90s github.com/kopia/kopia/...
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"

"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

func policyTargets(ctx context.Context, rep *repo.Repository, globalFlag *bool, targetsFlag *[]string) ([]snapshot.SourceInfo, error) {
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"

"github.com/kopia/kopia/internal/editor"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot/policy"
)

const policyEditHelpText = `
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"sort"

"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cli
import (
"context"

"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"

"github.com/kopia/kopia/fs/ignorefs"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_policy_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/kopia/kopia/internal/units"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_repository_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (

"github.com/kopia/kopia/fs/ignorefs"
"github.com/kopia/kopia/internal/units"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/repo/block"
"github.com/kopia/kopia/repo/object"
"github.com/kopia/kopia/repo/storage"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_snapshot_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"time"

"github.com/kopia/kopia/internal/upload"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_snapshot_estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/kopia/kopia/fs/ignorefs"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/snapshot/policy"

"github.com/kopia/kopia/repo"

Expand Down
2 changes: 1 addition & 1 deletion cli/command_snapshot_expire.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"sort"

"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/command_snapshot_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/kopia/kopia/fs"
"github.com/kopia/kopia/fs/repofs"
"github.com/kopia/kopia/internal/units"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/repo/object"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/server/api_policy_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"

"github.com/kopia/kopia/internal/serverapi"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/snapshot/policy"
)

func (s *Server) handlePolicyList(ctx context.Context, r *http.Request) (interface{}, *apiError) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/api_snapshot_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/kopia/kopia/fs"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

type snapshotListEntry struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/source_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/kopia/kopia/fs/localfs"
"github.com/kopia/kopia/internal/serverapi"
"github.com/kopia/kopia/internal/upload"
"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

// sourceManager manages the state machine of each source
Expand Down
2 changes: 1 addition & 1 deletion internal/serverapi/serverapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package serverapi
import (
"time"

"github.com/kopia/kopia/policy"
"github.com/kopia/kopia/repo/block"
"github.com/kopia/kopia/snapshot"
"github.com/kopia/kopia/snapshot/policy"
)

// StatusResponse is the response of 'status' HTTP API command.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// GlobalPolicySourceInfo is a source where global policy is attached.
var GlobalPolicySourceInfo = snapshot.SourceInfo{}

var log = kopialogging.Logger("kopia/policy")
var log = kopialogging.Logger("kopia/snapshot/policy")

// GetEffectivePolicy calculates effective snapshot policy for a given source by combining the source-specifc policy (if any)
// with parent policies. The source must contain a path.
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit d47f662

Please sign in to comment.