Documentation ¶
Index ¶
- Constants
- Variables
- func AddBoxDef(payload IBox, versions ...uint8)
- func AskForConfirmation() bool
- func AuthKeyHash(key []byte) []byte
- func CloseChannelWithoutPanic(c chan tl.Object)
- func FullStack()
- func GenerateSessionID() int64
- func GetAddr(dc int) string
- func NewMsgIDGenerator() func(timeOffset int64) int64
- func ParseDuration(file string) (int64, error)
- func RandomBytes(size int) []byte
- func ReadBoxStructure(r io.ReadSeeker, handler ReadHandler, params ...interface{}) ([]interface{}, error)
- func ReadBoxStructureFromInternal(r io.ReadSeeker, bi *BoxInfo, handler ReadHandler, params ...interface{}) (interface{}, error)
- func SearchAddr(addr string) int
- func SetDCs(dcs map[int][]string)
- func Sha1(input string) []byte
- func Sha1Byte(input []byte) []byte
- func Unmarshal(r io.ReadSeeker, payloadSize uint64, dst IBox, ctx Context) (n uint64, err error)
- func Xor(dst, src []byte)
- type BaseCustomFieldObject
- func (*BaseCustomFieldObject) BeforeUnmarshal(io.ReadSeeker, uint64, Context) (uint64, bool, error)
- func (box *BaseCustomFieldObject) GetFieldLength(string, Context) uint
- func (box *BaseCustomFieldObject) GetFieldSize(string, Context) uint
- func (box *BaseCustomFieldObject) IsOptFieldEnabled(string, Context) bool
- func (*BaseCustomFieldObject) OnReadField(string, ReadSeeker, uint64, Context) (uint64, bool, error)
- type Box
- type BoxInfo
- type BoxPath
- type BoxType
- type CompatibleBrandElem
- type Context
- type DCOptions
- type Ftyp
- type FullBox
- type IAnyType
- type IBox
- type ICustomFieldObject
- type IImmutableBox
- type Logger
- type Meta
- type Moov
- type Mvhd
- type PingParams
- type ProbeInfo
- type ReadHandle
- type ReadHandler
- type ReadSeeker
- type Reader
- type SyncIntObjectChan
- func (s *SyncIntObjectChan) Add(key int, value chan tl.Object)
- func (s *SyncIntObjectChan) Close()
- func (s *SyncIntObjectChan) Delete(key int) bool
- func (s *SyncIntObjectChan) Get(key int) (chan tl.Object, bool)
- func (s *SyncIntObjectChan) Has(key int) bool
- func (s *SyncIntObjectChan) Keys() []int
- func (s *SyncIntObjectChan) Reset()
- type SyncIntReflectTypes
- func (s *SyncIntReflectTypes) Add(key int, value []reflect.Type)
- func (s *SyncIntReflectTypes) Delete(key int) bool
- func (s *SyncIntReflectTypes) Get(key int) ([]reflect.Type, bool)
- func (s *SyncIntReflectTypes) Has(key int) bool
- func (s *SyncIntReflectTypes) Keys() []int
- func (s *SyncIntReflectTypes) Reset()
- type SyncSet
- func (s *SyncSet[T]) Add(key T) bool
- func (s *SyncSet[T]) Clear()
- func (s *SyncSet[T]) Clone() *SyncSet[T]
- func (s *SyncSet[T]) Delete(key T)
- func (s *SyncSet[T]) ForEach(fn func(key T) bool)
- func (s *SyncSet[T]) Has(key T) bool
- func (s *SyncSet[T]) Keys() []T
- func (s *SyncSet[T]) Len() int
- func (s *SyncSet[T]) Pop(key T) bool
- type UpdatesGetStateParams
Constants ¶
View Source
const ( // DebugLevel is the lowest level of logging DebugLevel = iota // InfoLevel is the second lowest level of logging InfoLevel // WarnLevel is the third highest level of logging WarnLevel // ErrorLevel is the highest level of logging ErrorLevel // NoLevel disables all logging NoLevel // TraceLevel is the highest level of logging TraceLevel )
View Source
const ( SmallHeaderSize = 8 LargeHeaderSize = 16 LengthUnlimited = math.MaxUint32 )
Variables ¶
View Source
var DcList = DCOptions{ DCS: map[int][]string{ 1: {"149.154.175.58:443"}, 2: {"149.154.167.50:443"}, 3: {"149.154.175.100:443"}, 4: {"149.154.167.91:443"}, 5: {"91.108.56.151:443"}, }, }
View Source
var ErrUnsupportedBoxVersion = errors.New("unsupported box version")
Functions ¶
func AskForConfirmation ¶
func AskForConfirmation() bool
func AuthKeyHash ¶
func GenerateSessionID ¶
func GenerateSessionID() int64
func NewMsgIDGenerator ¶
func ParseDuration ¶
func RandomBytes ¶
func ReadBoxStructure ¶
func ReadBoxStructure(r io.ReadSeeker, handler ReadHandler, params ...interface{}) ([]interface{}, error)
func ReadBoxStructureFromInternal ¶
func ReadBoxStructureFromInternal(r io.ReadSeeker, bi *BoxInfo, handler ReadHandler, params ...interface{}) (interface{}, error)
func SearchAddr ¶
Types ¶
type BaseCustomFieldObject ¶
type BaseCustomFieldObject struct{}
func (*BaseCustomFieldObject) BeforeUnmarshal ¶
func (*BaseCustomFieldObject) BeforeUnmarshal(io.ReadSeeker, uint64, Context) (uint64, bool, error)
func (*BaseCustomFieldObject) GetFieldLength ¶
func (box *BaseCustomFieldObject) GetFieldLength(string, Context) uint
func (*BaseCustomFieldObject) GetFieldSize ¶
func (box *BaseCustomFieldObject) GetFieldSize(string, Context) uint
func (*BaseCustomFieldObject) IsOptFieldEnabled ¶
func (box *BaseCustomFieldObject) IsOptFieldEnabled(string, Context) bool
func (*BaseCustomFieldObject) OnReadField ¶
func (*BaseCustomFieldObject) OnReadField(string, ReadSeeker, uint64, Context) (uint64, bool, error)
type Box ¶
type Box struct {
BaseCustomFieldObject
}
type BoxInfo ¶
type BoxInfo struct { Offset uint64 Size uint64 HeaderSize uint64 Type BoxType ExtendToEOF bool Context }
BoxInfo has common infomations of box
func ExtractBoxes ¶
func ReadBoxInfo ¶
func ReadBoxInfo(r io.ReadSeeker) (*BoxInfo, error)
type BoxType ¶
type BoxType [4]byte
func BoxTypeAny ¶
func BoxTypeAny() BoxType
func BoxTypeMeta ¶
func BoxTypeMeta() BoxType
func BoxTypeMoov ¶
func BoxTypeMoov() BoxType
func BoxTypeMvhd ¶
func BoxTypeMvhd() BoxType
func StrToBoxType ¶
func (BoxType) IsSupportedVersion ¶
type CompatibleBrandElem ¶
type CompatibleBrandElem struct {
CompatibleBrand [4]byte `mp4:"0,size=8,string"`
}
type Ftyp ¶
type Ftyp struct { Box MajorBrand [4]byte `mp4:"0,size=8,string"` MinorVersion uint32 `mp4:"1,size=32"` CompatibleBrands []CompatibleBrandElem `mp4:"2,size=32"` // reach to end of the box }
func (*Ftyp) HasCompatibleBrand ¶
type FullBox ¶
type FullBox struct { BaseCustomFieldObject Version uint8 `mp4:"0,size=8"` Flags [3]byte `mp4:"1,size=8"` }
func (*FullBox) GetVersion ¶
GetVersion returns the box version
func (*FullBox) RemoveFlag ¶
RemoveFlag removes the flag
func (*FullBox) SetVersion ¶
SetVersion sets the box version
type IBox ¶
type IBox interface { IImmutableBox SetVersion(uint8) SetFlags(uint32) AddFlag(uint32) RemoveFlag(uint32) }
IBox is common interface of box
func UnmarshalAny ¶
type ICustomFieldObject ¶
type ICustomFieldObject interface { GetFieldSize(name string, ctx Context) uint GetFieldLength(name string, ctx Context) uint IsOptFieldEnabled(name string, ctx Context) bool BeforeUnmarshal(r io.ReadSeeker, size uint64, ctx Context) (n uint64, override bool, err error) OnReadField(name string, r ReadSeeker, leftBits uint64, ctx Context) (rbits uint64, override bool, err error) }
type IImmutableBox ¶
type Logger ¶
Logger is the logging struct.
type Mvhd ¶
type Mvhd struct { FullBox `mp4:"0,extend"` CreationTimeV0 uint32 `mp4:"1,size=32,ver=0"` ModificationTimeV0 uint32 `mp4:"2,size=32,ver=0"` CreationTimeV1 uint64 `mp4:"3,size=64,ver=1"` ModificationTimeV1 uint64 `mp4:"4,size=64,ver=1"` Timescale uint32 `mp4:"5,size=32"` DurationV0 uint32 `mp4:"6,size=32,ver=0"` DurationV1 uint64 `mp4:"7,size=64,ver=1"` Rate int32 `mp4:"8,size=32"` Volume int16 `mp4:"9,size=16"` Reserved int16 `mp4:"10,size=16,const=0"` Reserved2 [2]uint32 `mp4:"11,size=32,const=0"` Matrix [9]int32 `mp4:"12,size=32,hex"` PreDefined [6]int32 `mp4:"13,size=32"` NextTrackID uint32 `mp4:"14,size=32"` }
Mvhd is ISOBMFF mvhd box type
func (*Mvhd) GetCreationTime ¶
func (*Mvhd) GetDuration ¶
func (*Mvhd) GetModificationTime ¶
func (*Mvhd) GetRateInt ¶
GetRateInt returns value of rate as int16
type PingParams ¶
type PingParams struct {
PingID int64
}
func (*PingParams) CRC ¶
func (*PingParams) CRC() uint32
type ReadHandle ¶
type ReadHandler ¶
type ReadHandler func(handle *ReadHandle) (val interface{}, err error)
type ReadSeeker ¶
func NewReadSeeker ¶
func NewReadSeeker(r io.ReadSeeker) ReadSeeker
type Reader ¶
type SyncIntObjectChan ¶
type SyncIntObjectChan struct {
// contains filtered or unexported fields
}
func NewSyncIntObjectChan ¶
func NewSyncIntObjectChan() *SyncIntObjectChan
func (*SyncIntObjectChan) Close ¶
func (s *SyncIntObjectChan) Close()
func (*SyncIntObjectChan) Delete ¶
func (s *SyncIntObjectChan) Delete(key int) bool
func (*SyncIntObjectChan) Has ¶
func (s *SyncIntObjectChan) Has(key int) bool
func (*SyncIntObjectChan) Keys ¶
func (s *SyncIntObjectChan) Keys() []int
func (*SyncIntObjectChan) Reset ¶
func (s *SyncIntObjectChan) Reset()
type SyncIntReflectTypes ¶
type SyncIntReflectTypes struct {
// contains filtered or unexported fields
}
func NewSyncIntReflectTypes ¶
func NewSyncIntReflectTypes() *SyncIntReflectTypes
func (*SyncIntReflectTypes) Delete ¶
func (s *SyncIntReflectTypes) Delete(key int) bool
func (*SyncIntReflectTypes) Has ¶
func (s *SyncIntReflectTypes) Has(key int) bool
func (*SyncIntReflectTypes) Keys ¶
func (s *SyncIntReflectTypes) Keys() []int
func (*SyncIntReflectTypes) Reset ¶
func (s *SyncIntReflectTypes) Reset()
type SyncSet ¶
type SyncSet[T comparable] struct { // contains filtered or unexported fields }
func NewSyncSet ¶
func NewSyncSet[T comparable]() *SyncSet[T]
type UpdatesGetStateParams ¶
type UpdatesGetStateParams struct{}
func (*UpdatesGetStateParams) CRC ¶
func (*UpdatesGetStateParams) CRC() uint32
Click to show internal directories.
Click to hide internal directories.