stream

package
v0.0.0-...-4ca9756 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StreamXMLName = xml.Name{Local: "stream:stream"}

Functions

func NewStream

func NewStream(rw io.ReadWriteCloser) *stream

Types

type Connection

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

func (*Connection) Close

func (self *Connection) Close() error

func (*Connection) SetRW

func (self *Connection) SetRW(rw io.ReadWriteCloser)

func (*Connection) UpdateRW

func (self *Connection) UpdateRW(srw SwapRW) error

type DependencyManageable

type DependencyManageable interface {
	Add(name string, depends ...string)
	Get(name string) []string
}

type Feature

type Feature interface {
	Name() string
	Required() bool
}

type FeatureContainable

type FeatureContainable interface {
	AddFeature(Feature)
	RemoveFeature(string)
	HasRequired() bool
	DependencyGraph() DependencyManageable
}

type FeatureContainer

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

func NewFeatureContainer

func NewFeatureContainer(dg DependencyManageable) *FeatureContainer

func (*FeatureContainer) AddFeature

func (fc *FeatureContainer) AddFeature(f Feature)

func (*FeatureContainer) DependencyGraph

func (fc *FeatureContainer) DependencyGraph() DependencyManageable

func (*FeatureContainer) HasRequired

func (fc *FeatureContainer) HasRequired() bool

func (*FeatureContainer) MarshalXML

func (fc *FeatureContainer) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*FeatureContainer) RemoveFeature

func (fc *FeatureContainer) RemoveFeature(name string)

type RawConfig

type RawConfig map[string]json.RawMessage

type ServerStream

type ServerStream interface {
	Stream
	FeatureContainable
	SendFeatures() error
	RequestedServerName() string
	ClientJID() string
	SetClientJID(string)
	ReOpen()
	Config() RawConfig
}

func NewServerStream

func NewServerStream(rw io.ReadWriteCloser, depGraph DependencyManageable, conf RawConfig) ServerStream

type State

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

func (*State) Get

func (self *State) Get(res interface{}) error

func (*State) Push

func (self *State) Push(states ...interface{})

type Stream

type Stream interface {
	xtream.Factory

	ID() string
	ServerName() string
	SetServerName(string)
	Open(StreamHandler) error
	Close() error
	State() *State
	Opened() bool
	Version() string
	SetVersion(string)
	UpdateRW(SwapRW) error
	ReadElement() (xtream.Element, error)
	WriteElement(xtream.Element) error
}

type StreamHandler

type StreamHandler func(ServerStream) error

type SwapRW

type SwapRW func(source_rw io.ReadWriteCloser) (io.ReadWriteCloser, error)

Directories

Path Synopsis
iq

Jump to

Keyboard shortcuts

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