utils

package
v1.1.7-0...-d08fa44 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPort = errors.New("invalid port")
)

Functions

func AddParamsToContact

func AddParamsToContact(contact *sip.ContactHeader, expires *sip.Expires)

func BuildContactHeader

func BuildContactHeader(name string, from, to sip.Message, expires *sip.Expires)

func GetBranchID

func GetBranchID(msg sip.Message) sip.MaybeString

func GetIP

func GetIP(addr string) string

func GetLoggers

func GetLoggers() map[string]*MyLogger

func GetPort

func GetPort(addr string) string

func ListenUDPInPortRange

func ListenUDPInPortRange(portMin, portMax int, laddr *net.UDPAddr) (*net.UDPConn, error)

func NewLogrusLogger

func NewLogrusLogger(level log.Level, prefix string, fields log.Fields) log.Logger

func SetLogLevel

func SetLogLevel(prefix string, level log.Level) error

func StrToUint16

func StrToUint16(str string) uint16

Types

type MyLogger

type MyLogger struct {
	Logger *log.LogrusLogger
	// contains filtered or unexported fields
}

func (*MyLogger) Level

func (ml *MyLogger) Level() string

Jump to

Keyboard shortcuts

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