mirror of https://github.com/mitchell/selfpass.git
Move service related filed to services folder
This commit is contained in:
parent
347fbe7268
commit
7d770ef150
|
@ -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
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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() {
|
|
@ -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 {
|
|
@ -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
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/mitchell/selfpass/cli/commands"
|
||||
"github.com/mitchell/selfpass/services/cli/commands"
|
||||
)
|
||||
|
||||
func main() {
|
|
@ -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)
|
|
@ -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 {
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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) {
|
|
@ -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) {
|
|
@ -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 {
|
|
@ -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) {
|
|
@ -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 {
|
|
@ -1,4 +1,4 @@
|
|||
module github.com/mitchell/selfpass
|
||||
module github.com/mitchell/selfpass/services
|
||||
|
||||
go 1.12
|
||||
|
Loading…
Reference in New Issue