Documentation ¶
Index ¶
- Constants
- func BaseContext() (ctx context.Context, cancel context.CancelFunc)
- func GetLocalNetOutboundIP() (net.IP, error)
- func GetOutboundIP() (net.IP, error)
- func GetUUID(str string) (uuid_ pgtype.UUID, err error)
- func OpenFile(name string, flag int) (f *os.File, err error)
- func PrettyPrintValue(v interface{}) (str string)
- func TrimUrlParams(s string, sub ...interface{}) string
- func WriteFile(name string, data []byte) error
- type BufferPool
- type BytesPool
- 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)
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 BaseContext ¶
func BaseContext() (ctx context.Context, cancel context.CancelFunc)
func GetLocalNetOutboundIP ¶
Get preferred outbound ip of this machine within 192.168.0.0/24
func PrettyPrintValue ¶
func PrettyPrintValue(v interface{}) (str string)
func TrimUrlParams ¶
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶
func NewBufferPool(n int) *BufferPool
func (*BufferPool) Get ¶
func (bp *BufferPool) Get() *bytes.Buffer
func (*BufferPool) Return ¶
func (bp *BufferPool) Return(b *bytes.Buffer)
type BytesPool ¶
type BytesPool struct {
// contains filtered or unexported fields
}
func NewBytesPool ¶
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)
Click to show internal directories.
Click to hide internal directories.