model

package
v0.0.0-...-3f804d4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const MaxAge = time.Minute * 20

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	// contains filtered or unexported fields
}
func NewLink() *Link

func (*Link) Accessed

func (c *Link) Accessed()

func (*Link) Chan

func (l *Link) Chan() chan *LinkData

func (*Link) Expired

func (c *Link) Expired() bool

func (*Link) WAuth

func (c *Link) WAuth(wSecret string) bool

type LinkData

type LinkData struct {
	Data     *PtpData
	BackChan chan *Meta
}

func NewLinkData

func NewLinkData(r *http.Request) *LinkData

type McastData

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

func NewMcastData

func NewMcastData() *McastData

func (*McastData) Close

func (md *McastData) Close()

func (*McastData) Read

func (md *McastData) Read(closeChan <-chan struct{}) (data *TeeData, ok bool)

func (*McastData) Size

func (md *McastData) Size() int

func (*McastData) Write

func (md *McastData) Write(data *TeeData)

type McastSeq

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

func NewMcastSeq

func NewMcastSeq(initialSeqId int) *McastSeq

func (*McastSeq) Accessed

func (c *McastSeq) Accessed()

func (*McastSeq) Close

func (ms *McastSeq) Close()

func (*McastSeq) DataCount

func (ms *McastSeq) DataCount() int

func (*McastSeq) Expired

func (c *McastSeq) Expired() bool

func (*McastSeq) GetData

func (ms *McastSeq) GetData(seqId int) (data *TeeData, ok bool)

func (*McastSeq) NewSeqId

func (ms *McastSeq) NewSeqId() int

func (*McastSeq) Read

func (ms *McastSeq) Read(wantedSeqId int, closeChan <-chan struct{}) (data *TeeData, seqId int, ok bool)

func (*McastSeq) Size

func (ms *McastSeq) Size() int

func (*McastSeq) WAuth

func (c *McastSeq) WAuth(wSecret string) bool

func (*McastSeq) Write

func (ms *McastSeq) Write(data *TeeData) (seqId int)

type Meta

type Meta struct {
	Time          time.Time
	Header        http.Header
	ContentType   string
	Method        string
	Query         string
	SrcIP         string
	SrcPort       string
	ContentLength int64
}

func NewMeta

func NewMeta(r *http.Request) *Meta

func (*Meta) Memory

func (m *Meta) Memory() int64

func (*Meta) WriteHeaders

func (m *Meta) WriteHeaders(w http.ResponseWriter, yourTime time.Time, content bool)

type ProxyCliData

type ProxyCliData struct {
	Url       string
	Method    string
	Scheme    string
	Host      string
	Port      string
	Path      string
	Query     string
	Fragment  string
	SerId     string
	Header    *http.Header
	Body      *buffreader.BuffReader
	RespChan  chan *ProxySerData
	RespChanL sync.Mutex
}

func NewProxyCliData

func NewProxyCliData(r *http.Request, serId, serPath string) (proxyReqData *ProxyCliData)

func (*ProxyCliData) CloseRespChan

func (pcd *ProxyCliData) CloseRespChan() (ok bool)

type ProxySer

type ProxySer struct {
	ReqChan chan *ProxyCliData
	// contains filtered or unexported fields
}

Creating when first request to/from server is made

func NewProxySer

func NewProxySer() *ProxySer

func (*ProxySer) Accessed

func (c *ProxySer) Accessed()

func (*ProxySer) AddJob

func (ps *ProxySer) AddJob(jobId string, proxyData *ProxyCliData)

func (*ProxySer) Expired

func (c *ProxySer) Expired() bool

func (*ProxySer) RemoveJob

func (ps *ProxySer) RemoveJob(cliData *ProxyCliData)

func (*ProxySer) TakeJob

func (ps *ProxySer) TakeJob(jobId string) (proxyData *ProxyCliData, ok bool)

func (*ProxySer) WAuth

func (c *ProxySer) WAuth(wSecret string) bool

type ProxySerData

type ProxySerData struct {
	Header *http.Header
	Body   *buffreader.BuffReader
}

func NewProxySerData

func NewProxySerData(r *http.Request) (proxyRespData *ProxySerData)

type PtpData

type PtpData struct {
	Meta    *Meta
	Content *buffreader.BuffReader
}

func NewPtpData

func NewPtpData(r *http.Request) *PtpData

func (*PtpData) Write

func (pd *PtpData) Write(w http.ResponseWriter, yourTime time.Time) (err error)

type SyncData

type SyncData struct {
	Data     *PtpData
	BackChan chan *PtpData
}

func NewSyncData

func NewSyncData(r *http.Request) *SyncData

type TeeData

type TeeData struct {
	Meta    *Meta
	Content *bufftee.BuffTee
	// contains filtered or unexported fields
}

func NewTeeData

func NewTeeData(r *http.Request) *TeeData

func (*TeeData) Cancel

func (td *TeeData) Cancel()

func (*TeeData) CopyContent

func (td *TeeData) CopyContent() (n int64, err error)

type Waiters

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

func NewWaiters

func NewWaiters() *Waiters

func (*Waiters) AddWaiter

func (w *Waiters) AddWaiter()

func (*Waiters) HasWaiters

func (w *Waiters) HasWaiters() bool

func (*Waiters) RemoveWaiter

func (w *Waiters) RemoveWaiter()

func (*Waiters) Wait

func (w *Waiters) Wait() <-chan struct{}

func (*Waiters) WaiterCount

func (w *Waiters) WaiterCount() int

Jump to

Keyboard shortcuts

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