Documentation ¶
Index ¶
- func CallEachFunc(ctx context.Context, list []func(ctx context.Context))
- func CheckImage(file io.ReadSeeker, expectedContentType string) error
- func Close(ctx context.Context, object io.Closer)
- func CloseFunc(object io.Closer) func(ctx context.Context)
- func DecodeImage(file io.ReadSeeker, expectedContentType string) (image.Image, error)
- func DecodeImageConfig(file io.ReadSeeker, expectedContentType string) (image.Config, error)
- func IP2int(ip net.IP) (uint32, error)
- func Int2ip(number uint32) net.IP
- func MustIP2int(ip net.IP) uint32
- func RoundFloat(x float64, precision int) float64
- func RoundFloat2(x float64) float64
- func RoundFloat4(x float64) float64
- func RoundFloat8(x float64) float64
- func Write(ctx context.Context, w io.Writer, bytes []byte)
- type MimeType
- type MimeTypeList
- func (mt *MimeTypeList) CheckContentType(contentType string) error
- func (mt *MimeTypeList) CheckExt(ext string) error
- func (mt *MimeTypeList) CheckExtByFileName(name string) error
- func (mt *MimeTypeList) ContentType(ext string) string
- func (mt *MimeTypeList) ContentTypeByFileName(name string) string
- func (mt *MimeTypeList) Ext(contentType string) string
- func (mt *MimeTypeList) NewListByExts(exts ...string) (*MimeTypeList, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallEachFunc ¶ added in v0.13.0
CallEachFunc - comment func.
func CheckImage ¶ added in v0.12.0
func CheckImage(file io.ReadSeeker, expectedContentType string) error
CheckImage - comment func.
func DecodeImage ¶ added in v0.12.0
DecodeImage - comment func.
func DecodeImageConfig ¶ added in v0.12.0
DecodeImageConfig - comment func.
func RoundFloat ¶ added in v0.20.0
RoundFloat - возвращает округлённую версию числа x с указанной точностью. Особые случаи: - Round(±0) = ±0; - Round(±Inf) = ±Inf; - Round(NaN) = NaN.
func RoundFloat2 ¶ added in v0.20.0
RoundFloat2 - возвращает RoundFloat с точностью 2.
func RoundFloat4 ¶ added in v0.20.0
RoundFloat4 - возвращает RoundFloat с точностью 4.
func RoundFloat8 ¶ added in v0.20.0
RoundFloat8 - возвращает RoundFloat с точностью 8.
Types ¶
type MimeTypeList ¶ added in v0.18.0
type MimeTypeList struct {
// contains filtered or unexported fields
}
MimeTypeList - comment struct.
func NewMimeTypeList ¶ added in v0.18.0
func NewMimeTypeList(items []MimeType) *MimeTypeList
NewMimeTypeList - создаёт объект MimeTypeList.
func (*MimeTypeList) CheckContentType ¶ added in v0.18.0
func (mt *MimeTypeList) CheckContentType(contentType string) error
CheckContentType - comment method.
func (*MimeTypeList) CheckExt ¶ added in v0.18.0
func (mt *MimeTypeList) CheckExt(ext string) error
CheckExt - comment method.
func (*MimeTypeList) CheckExtByFileName ¶ added in v0.18.0
func (mt *MimeTypeList) CheckExtByFileName(name string) error
CheckExtByFileName - comment method.
func (*MimeTypeList) ContentType ¶ added in v0.18.0
func (mt *MimeTypeList) ContentType(ext string) string
ContentType - comment method.
func (*MimeTypeList) ContentTypeByFileName ¶ added in v0.18.0
func (mt *MimeTypeList) ContentTypeByFileName(name string) string
ContentTypeByFileName - comment method.
func (*MimeTypeList) Ext ¶ added in v0.18.0
func (mt *MimeTypeList) Ext(contentType string) string
Ext - comment method.
func (*MimeTypeList) NewListByExts ¶ added in v0.18.0
func (mt *MimeTypeList) NewListByExts(exts ...string) (*MimeTypeList, error)
NewListByExts - comment method.