Documentation
¶
Index ¶
- Constants
- func GetLocalNetOutboundIP() (net.IP, error)
- func GetOutboundIP() (net.IP, error)
- func OpenFile(name string, flag int) (f *os.File, err error)
- func WriteFile(name string, data []byte) error
- type FilePermisson
- type JsonAtomicInt
- type MutexedMap
- func (mm *MutexedMap[T]) Clear()
- func (mm *MutexedMap[T]) Copy() (new_m map[string]T, count int)
- func (mm *MutexedMap[T]) Delete(key string) (t T, ok bool)
- func (mm *MutexedMap[T]) Get(key string) (t T, ok bool)
- func (mm *MutexedMap[T]) Keys() (keys []string)
- func (mm *MutexedMap[T]) Set(key string, value T)
- type MutexedQueue
Constants ¶
View Source
const ( S_IRWXU FilePermisson = 00700 // user (file owner) has read, write and execute permission S_IRUSR = 00400 // user has read permission S_IWUSR = 00200 // user has write permission S_IXUSR = 00100 // user has execute permission S_IRWXG = 00070 // group has read, write and execute permission S_IRGRP = 00040 // group has read permission S_IWGRP = 00020 // group has write permission S_IXGRP = 00010 // group has execute permission S_IRWXO = 00007 // others have read, write and execute permission S_IROTH = 00004 // others have read permission S_IWOTH = 00002 // others have write permission S_IXOTH = 00001 // others have execute permission )
View Source
const FS_MODE = fs.FileMode(S_IRWXO | S_IRWXU)
Variables ¶
This section is empty.
Functions ¶
func GetLocalNetOutboundIP ¶
Get preferred outbound ip of this machine within 192.168.0.0/24
Types ¶
type FilePermisson ¶
type FilePermisson int
type JsonAtomicInt ¶
func (*JsonAtomicInt) MarshalJSON ¶
func (x *JsonAtomicInt) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*JsonAtomicInt) MarshalText ¶
func (x *JsonAtomicInt) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*JsonAtomicInt) UnmarshalJSON ¶
func (x *JsonAtomicInt) UnmarshalJSON(text []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*JsonAtomicInt) UnmarshalText ¶
func (x *JsonAtomicInt) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type MutexedMap ¶
type MutexedMap[T any] struct { sync.RWMutex M map[string]T `json:"map"` // contains filtered or unexported fields }
func NewMutexedMap ¶
func NewMutexedMap[T any]() MutexedMap[T]
func (*MutexedMap[T]) Clear ¶
func (mm *MutexedMap[T]) Clear()
func (*MutexedMap[T]) Copy ¶
func (mm *MutexedMap[T]) Copy() (new_m map[string]T, count int)
func (*MutexedMap[T]) Delete ¶
func (mm *MutexedMap[T]) Delete(key string) (t T, ok bool)
func (*MutexedMap[T]) Get ¶
func (mm *MutexedMap[T]) Get(key string) (t T, ok bool)
func (*MutexedMap[T]) Keys ¶
func (mm *MutexedMap[T]) Keys() (keys []string)
func (*MutexedMap[T]) Set ¶
func (mm *MutexedMap[T]) Set(key string, value T)
type MutexedQueue ¶
type MutexedQueue[T any] struct { sync.RWMutex Queue MutexedMap[T] `json:"queue"` Done JsonAtomicInt `json:"done"` Pending JsonAtomicInt `json:"pending"` // contains filtered or unexported fields }
func NewMutexedQueue ¶
func NewMutexedQueue[T any]() (Mq *MutexedQueue[T])
func (*MutexedQueue[T]) Clear ¶
func (mq *MutexedQueue[T]) Clear()
func (*MutexedQueue[T]) Dequeue ¶
func (mq *MutexedQueue[T]) Dequeue() <-chan int64
func (*MutexedQueue[T]) Enqueue ¶
func (mq *MutexedQueue[T]) Enqueue(item T) (retry bool)
func (*MutexedQueue[T]) Get ¶
func (mq *MutexedQueue[T]) Get(n int64) (it T, ok bool)
func (*MutexedQueue[T]) Len ¶
func (mq *MutexedQueue[T]) Len() (n int64)
func (*MutexedQueue[T]) MarkDone ¶
func (mq *MutexedQueue[T]) MarkDone(n int64)
Click to show internal directories.
Click to hide internal directories.