mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
format Go source code.
This commit is contained in:
parent
732764991b
commit
45679f1b86
@ -5,8 +5,8 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"demodesk/neko"
|
||||
"demodesk/neko/modules"
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/modules"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -3,8 +3,8 @@ package members
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type MemberDataPayload struct {
|
||||
|
@ -6,9 +6,9 @@ import (
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
)
|
||||
|
||||
type key int
|
||||
|
@ -3,9 +3,9 @@ package room
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types/event"
|
||||
"demodesk/neko/internal/types/message"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type BroadcastStatusPayload struct {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
//"strings"
|
||||
"net/http"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type ClipboardPayload struct {
|
||||
|
@ -5,10 +5,10 @@ import (
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types/event"
|
||||
"demodesk/neko/internal/types/message"
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
)
|
||||
|
||||
type ControlStatusPayload struct {
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
|
@ -3,8 +3,8 @@ package room
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type KeyboardMapData struct {
|
||||
|
@ -3,8 +3,8 @@ package room
|
||||
import (
|
||||
"bytes"
|
||||
"image/jpeg"
|
||||
"strconv"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/event"
|
||||
|
@ -1,12 +1,12 @@
|
||||
package room
|
||||
|
||||
import (
|
||||
"os"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
"net/http"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
@ -7,10 +7,10 @@ import (
|
||||
|
||||
"demodesk/neko/internal/api/members"
|
||||
"demodesk/neko/internal/api/room"
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/config"
|
||||
)
|
||||
|
||||
type ApiManagerCtx struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"time"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type SessionLoginPayload struct {
|
||||
|
@ -2,8 +2,8 @@ package capture
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -8,8 +8,8 @@ package gst
|
||||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
"sync"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
|
@ -7,9 +7,9 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/codec"
|
||||
"demodesk/neko/internal/config"
|
||||
)
|
||||
|
||||
type CaptureManagerCtx struct {
|
||||
|
@ -2,15 +2,15 @@ package capture
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/capture/gst"
|
||||
"demodesk/neko/internal/types"
|
||||
)
|
||||
|
||||
type ScreencastManagerCtx struct {
|
||||
|
@ -2,15 +2,15 @@ package capture
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"reflect"
|
||||
"sync"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/capture/gst"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/codec"
|
||||
"demodesk/neko/internal/capture/gst"
|
||||
)
|
||||
|
||||
type StreamManagerCtx struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
|
@ -52,7 +52,7 @@ func (manager *DesktopManagerCtx) DropFiles(x int, y int, files []string) bool {
|
||||
case succeeded := <-finished:
|
||||
return succeeded
|
||||
case <-time.After(1 * time.Second):
|
||||
drop.CloseWindow();
|
||||
drop.CloseWindow()
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ func OpenWindow(files []string) {
|
||||
defer mu.Unlock()
|
||||
|
||||
size := C.int(len(files))
|
||||
urisUnsafe := C.dragUrisMake(size);
|
||||
urisUnsafe := C.dragUrisMake(size)
|
||||
defer C.dragUrisFree(urisUnsafe, size)
|
||||
|
||||
for i, file := range files {
|
||||
|
@ -2,8 +2,8 @@ package desktop
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -2,16 +2,16 @@ package desktop
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/go-events"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/desktop/xorg"
|
||||
"demodesk/neko/internal/desktop/xevent"
|
||||
"demodesk/neko/internal/desktop/xorg"
|
||||
)
|
||||
|
||||
var mu = sync.Mutex{}
|
||||
|
@ -8,9 +8,9 @@ package xevent
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
"unsafe"
|
||||
"strings"
|
||||
|
||||
"github.com/kataras/go-events"
|
||||
)
|
||||
|
@ -2,11 +2,11 @@ package desktop
|
||||
|
||||
import (
|
||||
"image"
|
||||
"regexp"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/desktop/xorg"
|
||||
"demodesk/neko/internal/types"
|
||||
)
|
||||
|
||||
// TODO: Refactor.
|
||||
|
@ -11,8 +11,8 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
|
@ -2,9 +2,9 @@ package file
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
|
@ -1,11 +1,11 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/session/database/dummy"
|
||||
"demodesk/neko/internal/session/database/file"
|
||||
"demodesk/neko/internal/session/database/object"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/config"
|
||||
)
|
||||
|
||||
func New(config *config.Session) types.MembersDatabase {
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/session/database"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
|
@ -2,10 +2,10 @@ package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/png"
|
||||
"encoding/base64"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
)
|
||||
|
@ -1,10 +1,10 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"io"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
@ -3,18 +3,18 @@ package webrtc
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/pion/webrtc/v3"
|
||||
"github.com/pion/webrtc/v3/pkg/media"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/event"
|
||||
"demodesk/neko/internal/types/message"
|
||||
"demodesk/neko/internal/config"
|
||||
)
|
||||
|
||||
func New(desktop types.DesktopManager, capture types.CaptureManager, config *config.WebRTC) *WebRTCManagerCtx {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package webrtc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
|
@ -39,7 +39,6 @@ func (ws *WebSocketManagerCtx) fileChooserDialogEvents() {
|
||||
}, nil)
|
||||
})
|
||||
|
||||
|
||||
// when new user joins, and someone holds dialog, he shouldd be notified about it.
|
||||
ws.sessions.OnConnected(func(session types.Session) {
|
||||
if file_chooser_dialog_member == nil {
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"demodesk/neko/internal/types/message"
|
||||
)
|
||||
|
||||
|
||||
func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.KeyboardMap) error {
|
||||
if !session.IsHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
|
||||
|
@ -2,8 +2,8 @@ package handler
|
||||
|
||||
import (
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/message"
|
||||
"demodesk/neko/internal/types/event"
|
||||
"demodesk/neko/internal/types/message"
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) sendUnicast(session types.Session, payload *message.SendUnicast) error {
|
||||
|
@ -23,7 +23,7 @@ func (h *MessageHandlerCtx) SessionDeleted(session types.Session) error {
|
||||
message.MemberID{
|
||||
Event: event.MEMBER_DELETED,
|
||||
ID: session.ID(),
|
||||
}, nil);
|
||||
}, nil)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"demodesk/neko/internal/websocket/handler"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/types/event"
|
||||
"demodesk/neko/internal/types/message"
|
||||
"demodesk/neko/internal/websocket/handler"
|
||||
)
|
||||
|
||||
func New(
|
||||
|
10
neko.go
10
neko.go
@ -6,14 +6,14 @@ import (
|
||||
"os/signal"
|
||||
"runtime"
|
||||
|
||||
"demodesk/neko/internal/api"
|
||||
"demodesk/neko/internal/capture"
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/desktop"
|
||||
"demodesk/neko/internal/capture"
|
||||
"demodesk/neko/internal/webrtc"
|
||||
"demodesk/neko/internal/session"
|
||||
"demodesk/neko/internal/websocket"
|
||||
"demodesk/neko/internal/api"
|
||||
"demodesk/neko/internal/http"
|
||||
"demodesk/neko/internal/session"
|
||||
"demodesk/neko/internal/webrtc"
|
||||
"demodesk/neko/internal/websocket"
|
||||
"demodesk/neko/modules"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
|
Loading…
Reference in New Issue
Block a user