Commit e1b0e42c authored by Eric's avatar Eric

rename project to koko

parent d0792ee3
package main package main
import ( import (
"cocogo/pkg/coco" "koko/pkg/coco"
) )
func main() { func main() {
......
...@@ -6,12 +6,12 @@ import ( ...@@ -6,12 +6,12 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/cctx" "koko/pkg/cctx"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/service" "koko/pkg/service"
) )
var mfaInstruction = i18n.T("Please enter 6 digits.") var mfaInstruction = i18n.T("Please enter 6 digits.")
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
"cocogo/pkg/model" "koko/pkg/model"
) )
type contextKey struct { type contextKey struct {
......
...@@ -7,11 +7,11 @@ import ( ...@@ -7,11 +7,11 @@ import (
"syscall" "syscall"
"time" "time"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/httpd" "koko/pkg/httpd"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/service" "koko/pkg/service"
"cocogo/pkg/sshd" "koko/pkg/sshd"
) )
const version = "1.4.0" const version = "1.4.0"
......
...@@ -6,11 +6,11 @@ import ( ...@@ -6,11 +6,11 @@ import (
"strings" "strings"
"time" "time"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/proxy" "koko/pkg/proxy"
"cocogo/pkg/service" "koko/pkg/service"
) )
func Initial() { func Initial() {
......
...@@ -8,10 +8,10 @@ import ( ...@@ -8,10 +8,10 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
var defaultTitle string var defaultTitle string
......
...@@ -5,11 +5,11 @@ import ( ...@@ -5,11 +5,11 @@ import (
"strconv" "strconv"
"strings" "strings"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
func NewAssetPagination(term *utils.Terminal, assets []model.Asset) *AssetPagination { func NewAssetPagination(term *utils.Terminal, assets []model.Asset) *AssetPagination {
......
...@@ -12,14 +12,14 @@ import ( ...@@ -12,14 +12,14 @@ import (
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
"github.com/xlab/treeprint" "github.com/xlab/treeprint"
"cocogo/pkg/cctx" "koko/pkg/cctx"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/proxy" "koko/pkg/proxy"
"cocogo/pkg/service" "koko/pkg/service"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
type assetsCacheContainer struct { type assetsCacheContainer struct {
......
...@@ -14,12 +14,12 @@ import ( ...@@ -14,12 +14,12 @@ import (
"github.com/pkg/sftp" "github.com/pkg/sftp"
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/cctx" "koko/pkg/cctx"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/service" "koko/pkg/service"
"cocogo/pkg/srvconn" "koko/pkg/srvconn"
) )
func SftpHandler(sess ssh.Session) { func SftpHandler(sess ssh.Session) {
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
socketio "github.com/googollee/go-socket.io" socketio "github.com/googollee/go-socket.io"
"cocogo/pkg/model" "koko/pkg/model"
) )
type Client struct { type Client struct {
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
socketio "github.com/googollee/go-socket.io" socketio "github.com/googollee/go-socket.io"
"cocogo/pkg/model" "koko/pkg/model"
) )
var conns = &connections{container: make(map[string]*WebConn), mu: new(sync.RWMutex)} var conns = &connections{container: make(map[string]*WebConn), mu: new(sync.RWMutex)}
......
package httpd package httpd
import "cocogo/pkg/model" import "koko/pkg/model"
type WebContext struct { type WebContext struct {
User *model.User User *model.User
......
...@@ -11,10 +11,10 @@ import ( ...@@ -11,10 +11,10 @@ import (
socketio "github.com/googollee/go-socket.io" socketio "github.com/googollee/go-socket.io"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"cocogo/pkg/cctx" "koko/pkg/cctx"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/service" "koko/pkg/service"
) )
func AuthDecorator(handler http.HandlerFunc) http.HandlerFunc { func AuthDecorator(handler http.HandlerFunc) http.HandlerFunc {
......
...@@ -10,9 +10,9 @@ import ( ...@@ -10,9 +10,9 @@ import (
socketio "github.com/googollee/go-socket.io" socketio "github.com/googollee/go-socket.io"
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/proxy" "koko/pkg/proxy"
"cocogo/pkg/service" "koko/pkg/service"
) )
// OnConnectHandler 当websocket连接后触发 // OnConnectHandler 当websocket连接后触发
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
socketio "github.com/googollee/go-socket.io" socketio "github.com/googollee/go-socket.io"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
var ( var (
......
package httpd package httpd
import ( import (
"cocogo/pkg/common"
"cocogo/pkg/srvconn"
"fmt" "fmt"
"io" "io"
"os" "os"
...@@ -14,10 +12,12 @@ import ( ...@@ -14,10 +12,12 @@ import (
"github.com/pkg/sftp" "github.com/pkg/sftp"
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/config" "koko/pkg/common"
"cocogo/pkg/logger" "koko/pkg/config"
"cocogo/pkg/model" "koko/pkg/logger"
"cocogo/pkg/service" "koko/pkg/model"
"koko/pkg/service"
"koko/pkg/srvconn"
) )
var ( var (
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"github.com/leonelquinteros/gotext" "github.com/leonelquinteros/gotext"
"cocogo/pkg/config" "koko/pkg/config"
) )
func init() { func init() {
......
package logger package logger
import ( import (
"cocogo/pkg/common"
"fmt" "fmt"
"os" "os"
"path" "path"
...@@ -9,7 +8,8 @@ import ( ...@@ -9,7 +8,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"cocogo/pkg/config" "koko/pkg/common"
"koko/pkg/config"
) )
var logger = logrus.New() var logger = logrus.New()
......
...@@ -5,10 +5,10 @@ import ( ...@@ -5,10 +5,10 @@ import (
"fmt" "fmt"
"sync" "sync"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
var ( var (
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
var ps1Pattern = regexp.MustCompile(`^\[?.*@.*\]?[\\$#]\s|mysql>\s`) var ps1Pattern = regexp.MustCompile(`^\[?.*@.*\]?[\\$#]\s|mysql>\s`)
......
...@@ -6,13 +6,13 @@ import ( ...@@ -6,13 +6,13 @@ import (
"strings" "strings"
"time" "time"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/service" "koko/pkg/service"
"cocogo/pkg/srvconn" "koko/pkg/srvconn"
"cocogo/pkg/utils" "koko/pkg/utils"
) )
type ProxyServer struct { type ProxyServer struct {
......
...@@ -8,10 +8,10 @@ import ( ...@@ -8,10 +8,10 @@ import (
"strings" "strings"
"time" "time"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
func NewCommandRecorder(sid string) (recorder *CommandRecorder) { func NewCommandRecorder(sid string) (recorder *CommandRecorder) {
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"github.com/Azure/azure-storage-blob-go/azblob" "github.com/Azure/azure-storage-blob-go/azblob"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
type AzureReplayStorage struct { type AzureReplayStorage struct {
......
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
"github.com/elastic/go-elasticsearch" "github.com/elastic/go-elasticsearch"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
type ESCommandStorage struct { type ESCommandStorage struct {
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"cocogo/pkg/model" "koko/pkg/model"
) )
func NewFileCommandStorage(name string) (storage *FileCommandStorage, err error) { func NewFileCommandStorage(name string) (storage *FileCommandStorage, err error) {
......
...@@ -3,7 +3,7 @@ package recorderstorage ...@@ -3,7 +3,7 @@ package recorderstorage
import ( import (
"github.com/aliyun/aliyun-oss-go-sdk/oss" "github.com/aliyun/aliyun-oss-go-sdk/oss"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
type OSSReplayStorage struct { type OSSReplayStorage struct {
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/aws/aws-sdk-go/service/s3/s3manager"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
type S3ReplayStorage struct { type S3ReplayStorage struct {
......
...@@ -4,8 +4,8 @@ import ( ...@@ -4,8 +4,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/service" "koko/pkg/service"
) )
type ServerCommandStorage struct { type ServerCommandStorage struct {
......
package proxy package proxy
import ( import (
"cocogo/pkg/i18n"
"cocogo/pkg/logger"
"cocogo/pkg/model"
"cocogo/pkg/service"
"cocogo/pkg/utils"
"sync" "sync"
"time" "time"
"koko/pkg/i18n"
"koko/pkg/logger"
"koko/pkg/model"
"koko/pkg/service"
"koko/pkg/utils"
) )
var sessionMap = make(map[string]*SwitchSession) var sessionMap = make(map[string]*SwitchSession)
......
package proxy package proxy
import ( import (
"cocogo/pkg/srvconn"
"context" "context"
"fmt" "fmt"
"strings" "strings"
...@@ -9,11 +8,12 @@ import ( ...@@ -9,11 +8,12 @@ import (
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/i18n" "koko/pkg/i18n"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
"cocogo/pkg/utils" "koko/pkg/srvconn"
"koko/pkg/utils"
) )
func NewSwitchSession(p *ProxyServer) (sw *SwitchSession) { func NewSwitchSession(p *ProxyServer) (sw *SwitchSession) {
......
...@@ -3,7 +3,7 @@ package proxy ...@@ -3,7 +3,7 @@ package proxy
import ( import (
"io" "io"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
type Transport interface { type Transport interface {
......
...@@ -3,9 +3,9 @@ package proxy ...@@ -3,9 +3,9 @@ package proxy
import ( import (
"strings" "strings"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/model" "koko/pkg/model"
storage "cocogo/pkg/proxy/recorderstorage" storage "koko/pkg/proxy/recorderstorage"
) )
type ReplayStorage interface { type ReplayStorage interface {
......
...@@ -8,9 +8,9 @@ import ( ...@@ -8,9 +8,9 @@ import (
"path" "path"
"strings" "strings"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
var ( var (
......
...@@ -3,8 +3,8 @@ package service ...@@ -3,8 +3,8 @@ package service
import ( import (
"fmt" "fmt"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info model.SystemUserAuthInfo) { func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info model.SystemUserAuthInfo) {
......
...@@ -7,9 +7,9 @@ import ( ...@@ -7,9 +7,9 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"cocogo/pkg/common" "koko/pkg/common"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
var client = common.NewClient(30, "") var client = common.NewClient(30, "")
......
...@@ -3,8 +3,8 @@ package service ...@@ -3,8 +3,8 @@ package service
import ( import (
"fmt" "fmt"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
func GetUserAssets(userID, cachePolicy string) (assets model.AssetList) { func GetUserAssets(userID, cachePolicy string) (assets model.AssetList) {
......
...@@ -3,8 +3,8 @@ package service ...@@ -3,8 +3,8 @@ package service
import ( import (
"fmt" "fmt"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
func RegisterTerminal(name, token, comment string) (res model.Terminal) { func RegisterTerminal(name, token, comment string) (res model.Terminal) {
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
type AuthResp struct { type AuthResp struct {
......
package srvconn package srvconn
import ( import (
"cocogo/pkg/service" "koko/pkg/service"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
...@@ -12,8 +12,8 @@ import ( ...@@ -12,8 +12,8 @@ import (
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
var ( var (
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/model" "koko/pkg/model"
) )
type ServerSSHConnection struct { type ServerSSHConnection struct {
......
...@@ -10,8 +10,8 @@ import ( ...@@ -10,8 +10,8 @@ import (
gossh "golang.org/x/crypto/ssh" gossh "golang.org/x/crypto/ssh"
"cocogo/pkg/logger" "koko/pkg/logger"
"cocogo/pkg/model" "koko/pkg/model"
) )
const ( const (
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"cocogo/pkg/common" "koko/pkg/common"
) )
type HostKey struct { type HostKey struct {
......
...@@ -5,10 +5,10 @@ import ( ...@@ -5,10 +5,10 @@ import (
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
"cocogo/pkg/auth" "koko/pkg/auth"
"cocogo/pkg/config" "koko/pkg/config"
"cocogo/pkg/handler" "koko/pkg/handler"
"cocogo/pkg/logger" "koko/pkg/logger"
) )
var sshServer *ssh.Server var sshServer *ssh.Server
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment