data

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Length         = 4
	MaxMessageSize = 16 << 20
)

todo: make these values customizable

Variables

This section is empty.

Functions

func DecodeReader added in v1.0.3

func DecodeReader(r io.Reader, dst proto.Message) error

func DeviceName added in v1.0.3

func DeviceName() string

func EncodeWriter added in v1.0.3

func EncodeWriter(src proto.Message, w io.Writer) (int, error)

EncodeWriter encodes the source interface writes it to the destination io.Writer.

Types

type Channel added in v1.0.3

type Channel chan *Message

Channel is an interface for managing clipboard data.

type Greet

type Greet struct {
	*types.GreetMessage
}

func NewGreet

func NewGreet(metadata *MetaData) *Greet

func NewGreetFromProto

func NewGreetFromProto(m *types.GreetMessage) *Greet

func NewGreetFromReader added in v1.0.3

func NewGreetFromReader(reader io.Reader) (*Greet, error)

func (*Greet) MetaData added in v1.0.3

func (g *Greet) MetaData() *MetaData

func (*Greet) Release

func (g *Greet) Release()

type LastMessage

type LastMessage struct {
	*Message

	Update chan *Message
	// contains filtered or unexported fields
}

LastMessage which is stored in Node and serves to identify duplicate messages

func NewLastMessage

func NewLastMessage() *LastMessage

func (*LastMessage) Get

func (m *LastMessage) Get() *Message

func (*LastMessage) ListenUpdates

func (m *LastMessage) ListenUpdates()

ListenUpdates updates the lastMessage with the latest message received

type Message

type Message struct {
	// contains filtered or unexported fields
}

func MessageFrom

func MessageFrom(data []byte, metadata *MetaData) *Message

MessageFrom creates a new Message with the provided data.

func MessageFromProto

func MessageFromProto(m *types.Message) *Message

func ReceiveMessage added in v1.0.3

func ReceiveMessage(conn net.Conn, decrypter crypto.Decrypter) (*Message, error)

func (*Message) Duplicate

func (m *Message) Duplicate(new *Message) bool

func (*Message) From added in v1.0.3

func (m *Message) From() UniqueID

func (*Message) ID added in v1.0.3

func (m *Message) ID() UniqueID

func (*Message) Kind added in v1.0.3

func (m *Message) Kind() proto.Message

func (*Message) RawData added in v1.0.3

func (m *Message) RawData() []byte

func (*Message) Release

func (m *Message) Release()

func (*Message) WriteEncrypted added in v1.0.3

func (m *Message) WriteEncrypted(signer crypto.Signer, writer io.Writer) (int, error)

type MetaData added in v1.0.3

type MetaData struct {
	// contains filtered or unexported fields
}

func MetaDataFromKind added in v1.0.3

func MetaDataFromKind(device *types.Device) *MetaData

func SelfMetaData added in v1.0.3

func SelfMetaData() *MetaData

func (*MetaData) Kind added in v1.0.3

func (meta *MetaData) Kind() *types.Device

func (*MetaData) Name added in v1.1.0

func (meta *MetaData) Name() string

func (*MetaData) String added in v1.0.3

func (meta *MetaData) String() string

func (*MetaData) UniqueID added in v1.0.3

func (meta *MetaData) UniqueID() UniqueID

type UniqueID added in v1.0.3

type UniqueID = uuid.UUID

Jump to

Keyboard shortcuts

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