Versions in this module Expand all Collapse all v0 v0.2.4 Oct 27, 2021 v0.1.0 Jan 17, 2019 Changes in this version + const StatusAsyncEvent + const StatusErrAuthenticationRequired + const StatusErrBadAuthentication + const StatusErrInternalError + const StatusErrInvalidConfigValue + const StatusErrInvalidDescriptor + const StatusErrResourceExhausted + const StatusErrSyntaxError + const StatusErrSyntaxErrorArg + const StatusErrUnimplementedCmd + const StatusErrUnmanagedEntity + const StatusErrUnrecognizedCmd + const StatusErrUnrecognizedCmdArg + const StatusErrUnrecognizedEntity + const StatusErrUnspecifiedTorError + const StatusOk + const StatusOkUnnecessary + var ErrEventWaitSynchronousResponseOccurred = errors.New("Synchronous event occurred during EventWait") + type AddOnionRequest struct + ClientAuths map[string]string + Flags []string + Key Key + MaxStreams int + Ports []*KeyVal + type AddOnionResponse struct + ClientAuths map[string]string + Key Key + RawResponse *Response + ServiceID string + type AddrMapEvent struct + Address string + Cached string + ErrorCode string + Expires time.Time + NewAddress string + Raw string + func ParseAddrMapEvent(raw string) *AddrMapEvent + func (*AddrMapEvent) Code() EventCode + type BandwidthEvent struct + BytesRead int64 + BytesWritten int64 + Raw string + func ParseBandwidthEvent(raw string) *BandwidthEvent + func (*BandwidthEvent) Code() EventCode + type BuildTimeoutSetEvent struct + Alpha float32 + CloseRate float32 + CloseTimeout time.Duration + Quantile float32 + Raw string + Timeout time.Duration + TimeoutRate float32 + TotalTimes int + Type string + Xm int + func ParseBuildTimeoutSetEvent(raw string) *BuildTimeoutSetEvent + func (*BuildTimeoutSetEvent) Code() EventCode + type CellStatsEvent struct + CircuitID string + InboundAdded map[string]int + InboundConnID string + InboundQueueID string + InboundRemoved map[string]int + InboundTime map[string]int + OutboundAdded map[string]int + OutboundConnID string + OutboundQueueID string + OutboundRemoved map[string]int + OutboundTime map[string]int + Raw string + func ParseCellStatsEvent(raw string) *CellStatsEvent + func (*CellStatsEvent) Code() EventCode + type CircuitBandwidthEvent struct + BytesRead int64 + BytesWritten int64 + CircuitID string + Raw string + Time time.Time + func ParseCircuitBandwidthEvent(raw string) *CircuitBandwidthEvent + func (*CircuitBandwidthEvent) Code() EventCode + type CircuitEvent struct + BuildFlags []string + CircuitID string + HSState string + Path []string + Purpose string + Raw string + Reason string + RemoteReason string + RendQuery string + SocksPassword string + SocksUsername string + Status string + TimeCreated time.Time + func ParseCircuitEvent(raw string) *CircuitEvent + func (*CircuitEvent) Code() EventCode + type CircuitMinorEvent struct + BuildFlags []string + CircuitID string + Event string + HSState string + OldHSState string + OldPurpose string + Path []string + Purpose string + Raw string + RendQuery string + TimeCreated time.Time + func ParseCircuitMinorEvent(raw string) *CircuitMinorEvent + func (*CircuitMinorEvent) Code() EventCode + type ClientsSeenEvent struct + CountrySummary map[string]int + IPVersions map[string]int + Raw string + TimeStarted time.Time + func ParseClientsSeenEvent(raw string) *ClientsSeenEvent + func (*ClientsSeenEvent) Code() EventCode + type ConfChangedEvent struct + Raw []string + func ParseConfChangedEvent(raw []string) *ConfChangedEvent + func (*ConfChangedEvent) Code() EventCode + type Conn struct + Authenticated bool + DebugWriter io.Writer + func NewConn(conn *textproto.Conn) *Conn + func (c *Conn) AddEventListener(ch chan<- Event, events ...EventCode) error + func (c *Conn) AddOnion(req *AddOnionRequest) (*AddOnionResponse, error) + func (c *Conn) AttachStream(streamID string, circuitID string, hopNum int) error + func (c *Conn) Authenticate(password string) error + func (c *Conn) Close() error + func (c *Conn) CloseCircuit(circuitID string, flags []string) error + func (c *Conn) CloseStream(streamID string, reason string) error + func (c *Conn) DelOnion(serviceID string) error + func (c *Conn) DropGuards() error + func (c *Conn) EventWait(ctx context.Context, events []EventCode, predicate func(Event) (bool, error)) (Event, error) + func (c *Conn) ExtendCircuit(circuitID string, path []string, purpose string) (string, error) + func (c *Conn) GetConf(keys ...string) ([]*KeyVal, error) + func (c *Conn) GetHiddenServiceDescriptorAsync(address string, server string) error + func (c *Conn) GetInfo(keys ...string) ([]*KeyVal, error) + func (c *Conn) HandleEvents(ctx context.Context) error + func (c *Conn) HandleNextEvent() error + func (c *Conn) LoadConf(conf string) error + func (c *Conn) MapAddresses(addresses ...*KeyVal) ([]*KeyVal, error) + func (c *Conn) PostDescriptor(descriptor string, purpose string, cache string) error + func (c *Conn) PostHiddenServiceDescriptorAsync(desc string, servers []string, address string) error + func (c *Conn) ProtocolInfo() (*ProtocolInfo, error) + func (c *Conn) Quit() error + func (c *Conn) ReadResponse() (*Response, error) + func (c *Conn) RedirectStream(streamID string, address string, port int) error + func (c *Conn) RemoveEventListener(ch chan<- Event, events ...EventCode) error + func (c *Conn) ResetConf(entries ...*KeyVal) error + func (c *Conn) ResolveAsync(address string, reverse bool) error + func (c *Conn) SaveConf(force bool) error + func (c *Conn) SendRequest(format string, args ...interface{}) (*Response, error) + func (c *Conn) SetCircuitPurpose(circuitID string, purpose string) error + func (c *Conn) SetConf(entries ...*KeyVal) error + func (c *Conn) Signal(signal string) error + func (c *Conn) TakeOwnership() error + func (c *Conn) UseFeatures(features ...string) error + type ConnBandwidthEvent struct + BytesRead int64 + BytesWritten int64 + ConnID string + ConnType string + Raw string + func ParseConnBandwidthEvent(raw string) *ConnBandwidthEvent + func (*ConnBandwidthEvent) Code() EventCode + type DescChangedEvent struct + Raw string + func ParseDescChangedEvent(raw string) *DescChangedEvent + func (*DescChangedEvent) Code() EventCode + type ED25519Key struct + func ED25519KeyFromBlob(blob string) (*ED25519Key, error) + func (*ED25519Key) Type() KeyType + func (e *ED25519Key) Blob() string + type Event interface + Code func() EventCode + func ParseEvent(code EventCode, raw string, dataArray []string) Event + type EventCode string + const EventCodeAddrMap + const EventCodeBandwidth + const EventCodeBuildTimeoutSet + const EventCodeCellStats + const EventCodeCircuit + const EventCodeCircuitBandwidth + const EventCodeCircuitMinor + const EventCodeClientsSeen + const EventCodeConfChanged + const EventCodeConnBandwidth + const EventCodeDescChanged + const EventCodeGuard + const EventCodeHSDesc + const EventCodeHSDescContent + const EventCodeLogDebug + const EventCodeLogErr + const EventCodeLogInfo + const EventCodeLogNotice + const EventCodeLogWarn + const EventCodeNetworkLiveness + const EventCodeNetworkStatus + const EventCodeNewConsensus + const EventCodeNewDesc + const EventCodeORConn + const EventCodeSignal + const EventCodeStatusClient + const EventCodeStatusGeneral + const EventCodeStatusServer + const EventCodeStream + const EventCodeStreamBandwidth + const EventCodeTokenBucketEmpty + const EventCodeTransportLaunched + var EventCodeUnrecognized EventCode = "<unrecognized>" + func EventCodes() []EventCode + type GenKey KeyAlgo + func GenKeyFromBlob(blob string) GenKey + func (GenKey) Type() KeyType + func (g GenKey) Blob() string + type GuardEvent struct + Name string + Raw string + Status string + Type string + func ParseGuardEvent(raw string) *GuardEvent + func (*GuardEvent) Code() EventCode + type HSDescContentEvent struct + Address string + DescID string + Descriptor string + HSDir string + Raw string + func ParseHSDescContentEvent(raw string) *HSDescContentEvent + func (*HSDescContentEvent) Code() EventCode + type HSDescEvent struct + Action string + Address string + AuthType string + DescID string + HSDir string + HSDirIndex string + Raw string + Reason string + Replica int + func ParseHSDescEvent(raw string) *HSDescEvent + func (*HSDescEvent) Code() EventCode + type Key interface + Blob func() string + Type func() KeyType + func KeyFromString(str string) (Key, error) + type KeyAlgo string + const KeyAlgoBest + const KeyAlgoED25519V3 + const KeyAlgoRSA1024 + type KeyType string + const KeyTypeED25519V3 + const KeyTypeNew + const KeyTypeRSA1024 + type KeyVal struct + Key string + Val string + ValSetAndEmpty bool + func KeyVals(keysAndVals ...string) []*KeyVal + func NewKeyVal(key string, val string) *KeyVal + func (k *KeyVal) ValSet() bool + type LogEvent struct + Raw string + Severity EventCode + func ParseLogEvent(severity EventCode, raw string) *LogEvent + func (l *LogEvent) Code() EventCode + type NetworkLivenessEvent struct + Raw string + func ParseNetworkLivenessEvent(raw string) *NetworkLivenessEvent + func (*NetworkLivenessEvent) Code() EventCode + type NetworkStatusEvent struct + Raw string + func ParseNetworkStatusEvent(raw string) *NetworkStatusEvent + func (*NetworkStatusEvent) Code() EventCode + type NewConsensusEvent struct + Raw string + func ParseNewConsensusEvent(raw string) *NewConsensusEvent + func (*NewConsensusEvent) Code() EventCode + type NewDescEvent struct + Descs []string + Raw string + func ParseNewDescEvent(raw string) *NewDescEvent + func (*NewDescEvent) Code() EventCode + type ORConnEvent struct + ConnID string + NumCircuits int + Raw string + Reason string + Status string + Target string + func ParseORConnEvent(raw string) *ORConnEvent + func (*ORConnEvent) Code() EventCode + type ProtocolInfo struct + AuthMethods []string + CookieFile string + RawResponse *Response + TorVersion string + func (p *ProtocolInfo) HasAuthMethod(authMethod string) bool + type RSAKey struct + func RSA1024KeyFromBlob(blob string) (*RSAKey, error) + func (*RSAKey) Type() KeyType + func (r *RSAKey) Blob() string + type Response struct + Data []string + Err *textproto.Error + RawLines []string + Reply string + func (r *Response) DataWithReply() []string + func (r *Response) IsAsync() bool + func (r *Response) IsOk() bool + type SignalEvent struct + Raw string + func ParseSignalEvent(raw string) *SignalEvent + func (*SignalEvent) Code() EventCode + type StatusEvent struct + Action string + Arguments map[string]string + Raw string + Severity string + Type EventCode + func ParseStatusEvent(typ EventCode, raw string) *StatusEvent + func (s *StatusEvent) Code() EventCode + type StreamBandwidthEvent struct + BytesRead int64 + BytesWritten int64 + Raw string + Time time.Time + func ParseStreamBandwidthEvent(raw string) *StreamBandwidthEvent + func (*StreamBandwidthEvent) Code() EventCode + type StreamEvent struct + CircuitID string + Purpose string + Raw string + Reason string + RemoteReason string + Source string + SourceAddress string + SourcePort int + Status string + StreamID string + TargetAddress string + TargetPort int + func ParseStreamEvent(raw string) *StreamEvent + func (*StreamEvent) Code() EventCode + type TokenBucketEmptyEvent struct + BucketName string + ConnID string + LastRefil time.Duration + Raw string + ReadBucketEmpty time.Duration + WriteBucketEmpty time.Duration + func ParseTokenBucketEmptyEvent(raw string) *TokenBucketEmptyEvent + func (*TokenBucketEmptyEvent) Code() EventCode + type TransportLaunchedEvent struct + Address string + Name string + Port int + Raw string + Type string + func ParseTransportLaunchedEvent(raw string) *TransportLaunchedEvent + func (*TransportLaunchedEvent) Code() EventCode + type UnrecognizedEvent struct + EventCode EventCode + RawMultiLine []string + RawSingleLine string + func ParseUnrecognizedEvent(eventCode EventCode, rawSingleLine string, rawMultiLine []string) *UnrecognizedEvent + func (u *UnrecognizedEvent) Code() EventCode