Move service related filed to services folder

This commit is contained in:
mitchell 2019-07-10 22:33:22 -04:00
parent 347fbe7268
commit 7d770ef150
41 changed files with 50 additions and 50 deletions

View File

@ -1,11 +1,11 @@
FROM golang:1.11.5 as build
WORKDIR /go/src/github.com/mitchell/selfpass
WORKDIR /go/src/github.com/mitchell/selfpass/services
COPY . .
ENV GO111MODULE on
RUN make build
FROM debian:stable-20190506-slim
COPY --from=build /go/src/github.com/mitchell/selfpass/bin/server /usr/bin/server
COPY --from=build /go/src/github.com/mitchell/selfpass/services/bin/server /usr/bin/server
RUN groupadd -r selfpass && useradd --no-log-init -r -g selfpass selfpass
USER selfpass
WORKDIR /home/selfpass

View File

@ -7,8 +7,8 @@ import (
"github.com/spf13/cobra"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/crypto"
"github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/crypto"
)
func makeDecrypt(repo types.ConfigRepo) *cobra.Command {

View File

@ -5,7 +5,7 @@ import (
"github.com/spf13/cobra"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/services/cli/types"
)
func makeDecryptCfg(repo types.ConfigRepo) *cobra.Command {

View File

@ -7,8 +7,8 @@ import (
"github.com/spf13/cobra"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/crypto"
"github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/crypto"
)
func makeEncrypt(repo types.ConfigRepo) *cobra.Command {

View File

@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/services/cli/types"
)
func makeInit(repo types.ConfigRepo) *cobra.Command {

View File

@ -7,11 +7,11 @@ import (
"github.com/spf13/cobra"
"github.com/mitchell/selfpass/cli/repositories"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/credentials/commands"
credrepos "github.com/mitchell/selfpass/credentials/repositories"
credtypes "github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/cli/repositories"
"github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/credentials/commands"
credrepos "github.com/mitchell/selfpass/services/credentials/repositories"
credtypes "github.com/mitchell/selfpass/services/credentials/types"
)
func Execute() {

View File

@ -13,8 +13,8 @@ import (
"github.com/spf13/viper"
"gopkg.in/AlecAivazis/survey.v1"
"github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/crypto"
"github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/crypto"
)
func NewConfigManager(cfgFile *string) *ConfigManager {

View File

@ -15,12 +15,12 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"github.com/mitchell/selfpass/credentials/middleware"
"github.com/mitchell/selfpass/credentials/protobuf"
"github.com/mitchell/selfpass/credentials/repositories"
"github.com/mitchell/selfpass/credentials/service"
"github.com/mitchell/selfpass/credentials/transport"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/middleware"
"github.com/mitchell/selfpass/services/credentials/protobuf"
"github.com/mitchell/selfpass/services/credentials/repositories"
"github.com/mitchell/selfpass/services/credentials/service"
"github.com/mitchell/selfpass/services/credentials/transport"
"github.com/mitchell/selfpass/services/credentials/types"
)
var logger log.Logger

View File

@ -1,7 +1,7 @@
package main
import (
"github.com/mitchell/selfpass/cli/commands"
"github.com/mitchell/selfpass/services/cli/commands"
)
func main() {

View File

@ -9,7 +9,7 @@ import (
"gopkg.in/AlecAivazis/survey.v1"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
type CredentialClientInit func(ctx context.Context) (c types.CredentialClient)

View File

@ -12,9 +12,9 @@ import (
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
clitypes "github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/crypto"
clitypes "github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/credentials/types"
"github.com/mitchell/selfpass/services/crypto"
)
func MakeCreate(repo clitypes.ConfigRepo, initClient CredentialClientInit) *cobra.Command {

View File

@ -7,9 +7,9 @@ import (
"fmt"
"time"
clitypes "github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/crypto"
clitypes "github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/credentials/types"
"github.com/mitchell/selfpass/services/crypto"
"github.com/spf13/cobra"
)

View File

@ -11,8 +11,8 @@ import (
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
clitypes "github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/crypto"
clitypes "github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/crypto"
)
func MakeGet(repo clitypes.ConfigRepo, initClient CredentialClientInit) *cobra.Command {

View File

@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
func MakeList(initClient CredentialClientInit) *cobra.Command {

View File

@ -12,9 +12,9 @@ import (
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
clitypes "github.com/mitchell/selfpass/cli/types"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/crypto"
clitypes "github.com/mitchell/selfpass/services/cli/types"
"github.com/mitchell/selfpass/services/credentials/types"
"github.com/mitchell/selfpass/services/crypto"
)
func MakeUpdate(repo clitypes.ConfigRepo, initClient CredentialClientInit) *cobra.Command {

View File

@ -4,7 +4,7 @@ import (
"context"
"github.com/go-kit/kit/endpoint"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
func MakeCreateEndpoint(svc types.Service) endpoint.Endpoint {

View File

@ -5,7 +5,7 @@ import (
"time"
"github.com/go-kit/kit/log"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
func NewServiceLogger(l log.Logger, next types.Service) ServiceLogger {

View File

@ -10,10 +10,10 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"github.com/mitchell/selfpass/credentials/endpoints"
"github.com/mitchell/selfpass/credentials/protobuf"
"github.com/mitchell/selfpass/credentials/transport"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/endpoints"
"github.com/mitchell/selfpass/services/credentials/protobuf"
"github.com/mitchell/selfpass/services/credentials/transport"
"github.com/mitchell/selfpass/services/credentials/types"
)
func NewCredentialServiceClient(ctx context.Context, target, ca, cert, key string) (types.CredentialClient, error) {

View File

@ -4,7 +4,7 @@ import (
"context"
"github.com/mediocregopher/radix/v3"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
func NewRedisConn(networkType, address string, connCount uint, options ...radix.PoolOpt) (c RedisConn, err error) {

View File

@ -5,7 +5,7 @@ import (
"fmt"
"time"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/types"
)
func NewCredentials(repo types.CredentialRepo) Credentials {

View File

@ -5,9 +5,9 @@ import (
"github.com/golang/protobuf/ptypes"
"github.com/mitchell/selfpass/credentials/endpoints"
"github.com/mitchell/selfpass/credentials/protobuf"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/endpoints"
"github.com/mitchell/selfpass/services/credentials/protobuf"
"github.com/mitchell/selfpass/services/credentials/types"
)
func decodeGetAllMetadataRequest(ctx context.Context, request interface{}) (interface{}, error) {

View File

@ -9,9 +9,9 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/mitchell/selfpass/credentials/endpoints"
"github.com/mitchell/selfpass/credentials/protobuf"
"github.com/mitchell/selfpass/credentials/types"
"github.com/mitchell/selfpass/services/credentials/endpoints"
"github.com/mitchell/selfpass/services/credentials/protobuf"
"github.com/mitchell/selfpass/services/credentials/types"
)
func NewGRPCServer(svc types.Service, logger log.Logger) GRPCServer {

View File

@ -1,4 +1,4 @@
module github.com/mitchell/selfpass
module github.com/mitchell/selfpass/services
go 1.12