Documentation ¶
Index ¶
- Constants
- func Infer[T any](pkt GonnectPacket[any]) (*T, error)
- func WgFromContext(ctx context.Context) *sync.WaitGroup
- func WithIdentity(ctx context.Context, identity GonnectIdentity) context.Context
- func WithWg(ctx context.Context, wg *sync.WaitGroup) context.Context
- type ChanMsg
- type GonnectClipboard
- type GonnectClipboardConnect
- type GonnectIdentity
- type GonnectMessageType
- type GonnectPacket
- type GonnectPacketType
- type GonnectPair
- type GonnectPing
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 WithIdentity ¶
func WithIdentity(ctx context.Context, identity GonnectIdentity) context.Context
Types ¶
type ChanMsg ¶
A struct used for passing data between goroutines
func NewChanMsg ¶
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 ¶
func (GonnectClipboard) Type() GonnectMessageType
type GonnectClipboardConnect ¶
type GonnectClipboardConnect struct { GonnectClipboard Timestamp int `json:"timestamp"` }
func (GonnectClipboardConnect) Type ¶
func (GonnectClipboardConnect) Type() GonnectMessageType
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 ¶
func (GonnectIdentity) Type() GonnectMessageType
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 ¶
func (GonnectPair) Type() GonnectMessageType
type GonnectPing ¶
type GonnectPing struct {
Message *string `json:"message"`
}
func (GonnectPing) Type ¶
func (GonnectPing) Type() GonnectMessageType
Click to show internal directories.
Click to hide internal directories.