adc

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug bool
)

Functions

This section is empty.

Types

type CID

type CID = types.CID

type Conn

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

Conn is an ADC protocol connection.

func Dial

func Dial(addr string) (*Conn, error)

Dial connects to a specified address.

func DialContext

func DialContext(ctx context.Context, addr string) (*Conn, error)

DialContext connects to a specified address.

func NewConn

func NewConn(conn net.Conn) (*Conn, error)

NewConn runs an ADC protocol over a specified connection.

func (*Conn) Broadcast

func (c *Conn) Broadcast(from SID) adc.WriteStream

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection.

func (*Conn) Flush

func (c *Conn) Flush() error

Flush the underlying buffer. Should be called after each WritePacket batch.

func (*Conn) GetKeyPrints added in v0.25.0

func (c *Conn) GetKeyPrints() []string

GetKeyPrints returns keyprints set by TLS, if any.

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) OnLineR added in v0.16.4

func (c *Conn) OnLineR(fnc func(line []byte) (bool, error))

func (*Conn) OnLineW added in v0.16.4

func (c *Conn) OnLineW(fnc func(line []byte) (bool, error))

func (*Conn) ReadClientMsg

func (c *Conn) ReadClientMsg(deadline time.Time) (adc.Message, error)

func (*Conn) ReadInfoMsg

func (c *Conn) ReadInfoMsg(deadline time.Time) (adc.Message, error)

func (*Conn) ReadPacket

func (c *Conn) ReadPacket(deadline time.Time) (adc.Packet, error)

ReadPacket reads and decodes a single ADC command.

func (*Conn) ReadPacketRaw added in v0.25.0

func (c *Conn) ReadPacketRaw(deadline time.Time) (adc.Packet, error)

ReadPacketRaw reads and decodes a single ADC command. Caller must copy the payload.

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetWriteDeadline added in v0.16.4

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) SetWriteTimeout added in v0.16.4

func (c *Conn) SetWriteTimeout(dt time.Duration)

func (*Conn) WriteBroadcast

func (c *Conn) WriteBroadcast(id SID, msg adc.Message) error

func (*Conn) WriteClientMsg

func (c *Conn) WriteClientMsg(msg adc.Message) error

func (*Conn) WriteDirect

func (c *Conn) WriteDirect(id, targ SID, msg adc.Message) error

func (*Conn) WriteEcho

func (c *Conn) WriteEcho(id, targ SID, msg adc.Message) error

func (*Conn) WriteHubMsg

func (c *Conn) WriteHubMsg(msg adc.Message) error

func (*Conn) WriteInfoMsg

func (c *Conn) WriteInfoMsg(msg adc.Message) error

func (*Conn) WriteKeepAlive added in v0.16.4

func (c *Conn) WriteKeepAlive() error

func (*Conn) WritePacket

func (c *Conn) WritePacket(p adc.Packet) error

func (*Conn) ZOn added in v0.18.0

func (c *Conn) ZOn(lvl int) error

type PID

type PID = CID

type PingConfig added in v0.8.12

type PingConfig struct {
	Name       string
	ShareSize  uint64
	ShareFiles int
	Slots      int
	Hubs       int
}

type PingHubInfo

type PingHubInfo struct {
	adc.HubInfo
	Ext       []string
	KeyPrints []string
	Users     []adc.UserInfo
}

func Ping

func Ping(ctx context.Context, addr string, conf PingConfig) (*PingHubInfo, error)

type SID

type SID = types.SID

type TTH

type TTH = tiger.Hash

TTH is a Tiger Tree Hash value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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