internal

package
v0.0.0-...-ebb1a70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GonnectPingType             = GonnectMessageType("kdeconnect.ping")
	GonnectPairType             = GonnectMessageType("kdeconnect.pair")
	GonnectClipboardType        = GonnectMessageType("kdeconnect.clipboard")
	GonnectClipboardConnectType = GonnectMessageType("kdeconnect.clipboard.connect")
	GonnectIdentityType         = GonnectMessageType("kdeconnect.identity")
)
View Source
const (
	ProtocolVersion = 7
)

Variables

This section is empty.

Functions

func Infer

func Infer[T any](pkt GonnectPacket[any]) (*T, error)

func WgFromContext

func WgFromContext(ctx context.Context) *sync.WaitGroup

func WithIdentity

func WithIdentity(ctx context.Context, identity GonnectIdentity) context.Context

func WithWg

func WithWg(ctx context.Context, wg *sync.WaitGroup) context.Context

Types

type ChanMsg

type ChanMsg struct {
	Msg []byte
	Err error
}

A struct used for passing data between goroutines

func NewChanMsg

func NewChanMsg(msg []byte, err error) ChanMsg

Create a new ChanMsg and copy the underlying slice since it is not thread safe

type GonnectClipboard

type GonnectClipboard struct {
	Content string `json:"content"`
}

func (GonnectClipboard) Type

type GonnectClipboardConnect

type GonnectClipboardConnect struct {
	GonnectClipboard
	Timestamp int `json:"timestamp"`
}

func (GonnectClipboardConnect) Type

type GonnectIdentity

type GonnectIdentity struct {
	DeviceId             string   `json:"deviceId"`
	DeviceName           string   `json:"deviceName"`
	DeviceType           string   `json:"deviceType"`
	IncomingCapabilities []string `json:"incomingCapabilities"`
	OutgoingCapabilities []string `json:"outgoingCapabilities"`
	ProtocolVersion      int      `json:"protocolVersion"`
	TcpPort              uint16   `json:"tcpPort"`
}

func Identity

func Identity() GonnectIdentity

func IdentityFromContext

func IdentityFromContext(ctx context.Context) *GonnectIdentity

func (GonnectIdentity) Type

type GonnectMessageType

type GonnectMessageType string

type GonnectPacket

type GonnectPacket[T any] struct {
	Id   int64              `json:"id"`
	Type GonnectMessageType `json:"type"`
	Body T                  `json:"body"`
}

func NewGonnectPacket

func NewGonnectPacket[T GonnectPacketType](body T) GonnectPacket[T]

type GonnectPacketType

type GonnectPacketType interface {
	Type() GonnectMessageType
}

type GonnectPair

type GonnectPair struct {
	Pair bool `json:"pair"`
}

func (GonnectPair) Type

type GonnectPing

type GonnectPing struct {
	Message *string `json:"message"`
}

func (GonnectPing) Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL