header

package
v0.0.0-...-dd2792d Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Equals      = '='
	Semicolon   = ';'
	Space       = ' '
	Colon       = ':'
	At          = '@'
	LeftBrack   = '<'
	RightBrack  = '>'
	Comma       = ','
	DoubleQuote = '"'
	Quote       = '\''
	Slash       = '/'
)
View Source
const (
	NameTo              = "To"
	NameCSeq            = "CSeq"
	NameVia             = "Via"
	NameCallID          = "Call-ID"
	NameFrom            = "From"
	NameMaxForwards     = "Max-Forwards"
	NameContentType     = "Content-Type"
	NameContentLength   = "Content-Length"
	NameDate            = "Date"
	NameAuthorization   = "Authorization"
	NameWWWAuthenticate = "WWW-Authenticate"
	NameContact         = "Contact"
	NameAllow           = "Allow"
	NameAccept          = "Accept"
	NameExpires         = "Expires"
)
View Source
const (
	ParamNameNextNonce    = "nextnonce"
	ParamNameTag          = "tag"
	ParamNameUsername     = "username"
	ParamNameURI          = "uri"
	ParamNameDomain       = "domain"
	ParamNameCnonce       = "cnonce"
	ParamNamePassword     = "password"
	ParamNameResponse     = "response"
	ParamNameResponseAuth = "rspauth"
	ParamNameOpaque       = "opaque"
	ParamNameAlgorithm    = "algorithm"
	ParamNameDigest       = "digest"
	ParamNameSignedBy     = "signed-by"
	ParamNameSignature    = "signature"
	ParamNameNonce        = "nonce"
	ParamNameSrand        = "srand"
	ParamNameSnum         = "snum"
	ParamNameTargetName   = "targetname"
	ParamNameNonceCount   = "nc"
	ParamNamePubkey       = "pubkey"
	ParamNameCookie       = "cookie"
	ParamNameRealm        = "realm"
	ParamNameVersion      = "version"
	ParamNameStale        = "stale"
	ParamNameQop          = "qop"
	ParamNameNc           = "nc"
	ParamNamePurpose      = "purpose"
	ParamNameCard         = "card"
	ParamNameInfo         = "info"
	ParamNameAction       = "action"
	ParamNameProxy        = "proxy"
	ParamNameRedirect     = "redirect"
	ParamNameExpires      = "expires"
	ParamNameQ            = "q"
	ParamNameRender       = "render"
	ParamNameSession      = "session"
	ParamNameIcon         = "icon"
	ParamNameAlert        = "alert"
	ParamNameHandling     = "handling"
	ParamNameRequired     = "required"
	ParamNameOptional     = "optional"
	ParamNameEmergency    = "emergency"
	ParamNameUrgent       = "urgent"
	ParamNameNormal       = "normal"
	ParamNameNonUrgent    = "non-urgent"
	ParamNameDuration     = "duration"
	ParamNameBranch       = "branch"
	ParamNameHidden       = "hidden"
	ParamNameReceived     = "received"
	ParamNameMAddr        = "maddr"
	ParamNameTTL          = "ttl"
	ParamNameTransport    = "transport"
	ParamNameText         = "text"
	ParamNameCause        = "cause"
	ParamNameID           = "id"
	ParamNameRPort        = "rport"
	ParamNameToTag        = "to-tag"
	ParamNameFromTag      = "from-tag"
	ParamNameSIPInstance  = "+sip.instance"
	ParamNamePubGruu      = "pub-gruu"
	ParamNameTempGruu     = "temp-gruu"
	ParamNameGruu         = "gruu"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept struct {
	Methods []string
}

func NewAccept

func NewAccept() *Accept

func (*Accept) Clone

func (a *Accept) Clone() HeaderValue

func (*Accept) Marshal

func (a *Accept) Marshal() []byte

func (*Accept) Unmarshal

func (a *Accept) Unmarshal(b []byte) error

func (*Accept) WriteTo

func (a *Accept) WriteTo(w io.Writer) error

type Allow

type Allow struct {
	Methods []string
}

func NewAllow

func NewAllow() *Allow

func (*Allow) Clone

func (a *Allow) Clone() HeaderValue

func (*Allow) Marshal

func (a *Allow) Marshal() []byte

func (*Allow) Unmarshal

func (a *Allow) Unmarshal(b []byte) error

func (*Allow) WriteTo

func (a *Allow) WriteTo(w io.Writer) error

type Authorization

type Authorization struct {
	Credential string
	Params     *Params
}

func NewAuthorization

func NewAuthorization() *Authorization

func (*Authorization) Algorithm

func (auth *Authorization) Algorithm() (string, bool)

func (*Authorization) Clone

func (auth *Authorization) Clone() HeaderValue

func (*Authorization) Marshal

func (auth *Authorization) Marshal() []byte

func (*Authorization) Nonce

func (auth *Authorization) Nonce() (string, bool)

func (*Authorization) Realm

func (auth *Authorization) Realm() (string, bool)

func (*Authorization) Response

func (auth *Authorization) Response() (string, bool)

func (*Authorization) SetAlgorithm

func (auth *Authorization) SetAlgorithm(algorithm string)

func (*Authorization) SetNonce

func (auth *Authorization) SetNonce(nonce string)

func (*Authorization) SetRealm

func (auth *Authorization) SetRealm(realm string)

func (*Authorization) SetResponse

func (auth *Authorization) SetResponse(response string)

func (*Authorization) SetURI

func (auth *Authorization) SetURI(uri string)

func (*Authorization) SetUsername

func (auth *Authorization) SetUsername(username string)

func (*Authorization) URI

func (auth *Authorization) URI() (string, bool)

func (*Authorization) Unmarshal

func (auth *Authorization) Unmarshal(b []byte) error

func (*Authorization) Username

func (auth *Authorization) Username() (string, bool)

func (*Authorization) WriteTo

func (auth *Authorization) WriteTo(w io.Writer) error

type CSeq

type CSeq struct {
	Seq    int64
	Method string
}

func NewCSeq

func NewCSeq() *CSeq

func (*CSeq) Clone

func (c *CSeq) Clone() HeaderValue

func (*CSeq) Marshal

func (c *CSeq) Marshal() []byte

func (*CSeq) Unmarshal

func (c *CSeq) Unmarshal(b []byte) error

func (*CSeq) WriteTo

func (c *CSeq) WriteTo(w io.Writer) error

type CallID

type CallID struct {
	ID string
}

func NewCallID

func NewCallID() *CallID

func (*CallID) Clone

func (c *CallID) Clone() HeaderValue

func (*CallID) Marshal

func (c *CallID) Marshal() []byte

func (*CallID) Unmarshal

func (c *CallID) Unmarshal(b []byte) error

func (*CallID) WriteTo

func (c *CallID) WriteTo(w io.Writer) error

type Contact

type Contact struct {
	URI    *URI
	Params *Params
}

func NewContact

func NewContact() *Contact

func (*Contact) Clone

func (c *Contact) Clone() HeaderValue

func (*Contact) Marshal

func (c *Contact) Marshal() []byte

func (*Contact) SetTag

func (c *Contact) SetTag(tag string)

func (*Contact) Tag

func (c *Contact) Tag() (tag string, ok bool)

func (*Contact) Unmarshal

func (c *Contact) Unmarshal(b []byte) error

func (*Contact) WriteTo

func (c *Contact) WriteTo(w io.Writer) error

type ContentLength

type ContentLength struct {
	ContentLength int64
}

func NewContentLength

func NewContentLength() *ContentLength

func (*ContentLength) Clone

func (cl *ContentLength) Clone() HeaderValue

func (*ContentLength) Marshal

func (cl *ContentLength) Marshal() []byte

func (*ContentLength) Unmarshal

func (cl *ContentLength) Unmarshal(b []byte) error

func (*ContentLength) WriteTo

func (cl *ContentLength) WriteTo(w io.Writer) error

type Date

type Date struct {
	Date time.Time
}

func NewDate

func NewDate() *Date

func (*Date) Clone

func (d *Date) Clone() HeaderValue

func (*Date) Marshal

func (d *Date) Marshal() []byte

func (*Date) Unmarshal

func (d *Date) Unmarshal(b []byte) error

func (*Date) WriteTo

func (d *Date) WriteTo(w io.Writer) error

type Expires

type Expires struct {
	Expires int64
}

func NewExpires

func NewExpires() *Expires

func (*Expires) Clone

func (e *Expires) Clone() HeaderValue

func (*Expires) Marshal

func (e *Expires) Marshal() []byte

func (*Expires) Unmarshal

func (e *Expires) Unmarshal(b []byte) error

func (*Expires) WriteTo

func (e *Expires) WriteTo(w io.Writer) error

type From

type From struct {
	URI    *URI
	Params *Params
}

func NewFrom

func NewFrom() *From

func (*From) Clone

func (f *From) Clone() HeaderValue

func (*From) Marshal

func (f *From) Marshal() []byte

func (*From) SetTag

func (f *From) SetTag(tag string)

func (*From) Tag

func (f *From) Tag() (tag string, ok bool)

func (*From) Unmarshal

func (f *From) Unmarshal(b []byte) error

func (*From) WriteTo

func (f *From) WriteTo(w io.Writer) error

type HeaderValue

type HeaderValue interface {
	WriteTo(w io.Writer) error
	Marshal() []byte
	Clone() HeaderValue
	Unmarshal(b []byte) error
}

type HostPort

type HostPort struct {
	Host string
	Port int
}

func NewHostPort

func NewHostPort() *HostPort

func (*HostPort) Clone

func (hp *HostPort) Clone() HeaderValue

func (*HostPort) Marshal

func (hp *HostPort) Marshal() []byte

func (*HostPort) Unmarshal

func (hp *HostPort) Unmarshal(b []byte) (err error)

func (*HostPort) WriteTo

func (hp *HostPort) WriteTo(w io.Writer) error

type MaxForwards

type MaxForwards struct {
	MaxForwards int
}

func NewMaxForwards

func NewMaxForwards() *MaxForwards

func (*MaxForwards) Clone

func (mf *MaxForwards) Clone() HeaderValue

func (*MaxForwards) Marshal

func (mf *MaxForwards) Marshal() []byte

func (*MaxForwards) Unmarshal

func (mf *MaxForwards) Unmarshal(b []byte) error

func (*MaxForwards) WriteTo

func (mf *MaxForwards) WriteTo(w io.Writer) error

type Params

type Params struct {
	ListSeparator     string
	KeyValueSeparator string
	Quote             string
	// contains filtered or unexported fields
}

func NewParams

func NewParams(listSeparator, keyValueSeparator string) *Params

func NewParamsWithQuote

func NewParamsWithQuote(listSeparator, keyValueSeparator, quote string) *Params

func (*Params) Clone

func (p *Params) Clone() HeaderValue

func (*Params) Del

func (p *Params) Del(name string)

func (*Params) Get

func (p *Params) Get(name string) (val Value, ok bool)

func (*Params) Marshal

func (p *Params) Marshal() []byte

func (*Params) Set

func (p *Params) Set(name string, val Value)

func (*Params) Size

func (p *Params) Size() int

func (*Params) Unmarshal

func (p *Params) Unmarshal(b []byte) error

func (*Params) WriteTo

func (p *Params) WriteTo(w io.Writer) error

type Protocal

type Protocal struct {
	Name      string
	Version   string
	Transport string
}

func NewProtocal

func NewProtocal() *Protocal

func (*Protocal) Clone

func (proto *Protocal) Clone() HeaderValue

func (*Protocal) Marshal

func (proto *Protocal) Marshal() []byte

func (*Protocal) Unmarshal

func (proto *Protocal) Unmarshal(b []byte) error

func (*Protocal) WriteTo

func (proto *Protocal) WriteTo(w io.Writer) error

type String

type String struct {
	Value string
}

func NewString

func NewString() *String

func (*String) Clone

func (s *String) Clone() HeaderValue

func (*String) Marshal

func (s *String) Marshal() []byte

func (*String) Unmarshal

func (s *String) Unmarshal(b []byte) error

func (*String) WriteTo

func (s *String) WriteTo(w io.Writer) error

type To

type To struct {
	URI    *URI
	Params *Params
}

func NewTo

func NewTo() *To

func (*To) Clone

func (t *To) Clone() HeaderValue

func (*To) Marshal

func (t *To) Marshal() []byte

func (*To) Unmarshal

func (t *To) Unmarshal(b []byte) error

func (*To) WriteTo

func (t *To) WriteTo(w io.Writer) error

type URI

type URI struct {
	Scheme   string
	User     string
	Password string
	HostPort *HostPort
}

func NewURI

func NewURI() *URI

func (*URI) Clone

func (u *URI) Clone() HeaderValue

func (*URI) Marshal

func (u *URI) Marshal() []byte

func (*URI) Unmarshal

func (u *URI) Unmarshal(b []byte) (err error)

func (*URI) WriteTo

func (u *URI) WriteTo(w io.Writer) error

type Value

type Value []byte

func BoolValue

func BoolValue(b bool) Value

func IntValue

func IntValue(i int64) Value

func StringValue

func StringValue(s string) Value

func (Value) Bool

func (v Value) Bool() bool

func (Value) Clone

func (v Value) Clone() Value

func (Value) Int

func (v Value) Int() int64

func (Value) String

func (v Value) String() string

type Via

type Via struct {
	Protocal *Protocal
	SentBy   *HostPort
	Params   *Params
}

Via is sip via header value

func NewVia

func NewVia() *Via

func (*Via) Branch

func (v *Via) Branch() (branch string, ok bool)

func (*Via) Clone

func (v *Via) Clone() HeaderValue

func (*Via) MAddr

func (v *Via) MAddr() (maddr string, ok bool)

func (*Via) Marshal

func (v *Via) Marshal() []byte

Marshal to bytes

func (*Via) RPort

func (v *Via) RPort() (rport int, ok bool)

func (*Via) Received

func (v *Via) Received() (received string, ok bool)

func (*Via) SetBranch

func (v *Via) SetBranch(branch string)

func (*Via) SetMAddr

func (v *Via) SetMAddr(maddr string)

func (*Via) SetRPort

func (v *Via) SetRPort(rport string)

func (*Via) SetReceived

func (v *Via) SetReceived(received string)

func (*Via) SetTTL

func (v *Via) SetTTL(ttl int64)

func (*Via) TTL

func (v *Via) TTL() (ttl int64, ok bool)

func (*Via) Unmarshal

func (v *Via) Unmarshal(b []byte) (err error)

func (*Via) WriteTo

func (v *Via) WriteTo(w io.Writer) error

type WWWAuthenticate

type WWWAuthenticate struct {
	Credential string
	Params     *Params
}

func NewWWWAuthenticate

func NewWWWAuthenticate() *WWWAuthenticate

func (*WWWAuthenticate) Algorithm

func (wwwauth *WWWAuthenticate) Algorithm() (algorithm string, ok bool)

func (*WWWAuthenticate) Clone

func (wwwauth *WWWAuthenticate) Clone() HeaderValue

func (*WWWAuthenticate) Marshal

func (wwwauth *WWWAuthenticate) Marshal() []byte

func (*WWWAuthenticate) Nonce

func (wwwauth *WWWAuthenticate) Nonce() (string, bool)

func (*WWWAuthenticate) Opaque

func (wwwauth *WWWAuthenticate) Opaque() (opaque string, ok bool)

func (*WWWAuthenticate) Realm

func (wwwauth *WWWAuthenticate) Realm() (string, bool)

func (*WWWAuthenticate) SetAlgorithm

func (wwwauth *WWWAuthenticate) SetAlgorithm(algorithm string)

func (*WWWAuthenticate) SetNonce

func (wwwauth *WWWAuthenticate) SetNonce(nonce string)

func (*WWWAuthenticate) SetOpaque

func (wwwauth *WWWAuthenticate) SetOpaque(opaque string)

func (*WWWAuthenticate) SetRealm

func (wwwauth *WWWAuthenticate) SetRealm(realm string)

func (*WWWAuthenticate) Unmarshal

func (wwwauth *WWWAuthenticate) Unmarshal(b []byte) error

func (*WWWAuthenticate) WriteTo

func (wwwauth *WWWAuthenticate) WriteTo(w io.Writer) error

Jump to

Keyboard shortcuts

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