Documentation
¶
Index ¶
- Variables
- func ChangeExt(filename string, newExt string) string
- func ConfigDir() string
- func CopyFile(src, dst string) error
- func DeleteFile(path string) error
- func DirExists(dir string) bool
- func DownloadFile(filepath string, url string) error
- func ExpandEnvVars(ctx context.Context, value string) (string, error)
- func ExpandTilde(path string) string
- func FileExists(filename string) bool
- func FileSize(filename string) (int64, error)
- func GetInt(value string, defaultValue int) int
- func GetIntf(value string, defaultFunc func() int) int
- func GetMacAddr() ([]string, error)
- func HomeDir() string
- func HttpGetWithTimeout(url string, timeout time.Duration, headers map[string]string) (*http.Response, error)
- func PrintRequest(r *http.Request)
- func PrintResponse(r *http.Response)
- func StringInSlice(a string, list []string) bool
- func StripPort(hostport string) string
- func TrimExt(path string) string
- func TruncateString(str string, num int) string
- type AtomBool
- type IPInfo
- type IPSource
- type IPType
- type IoCContainer
- type ObjectID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Container = &IoCContainer{ objects: make(map[ObjectID]interface{}), } )
Functions ¶
func DeleteFile ¶
func DownloadFile ¶
func ExpandTilde ¶
func FileExists ¶
func GetMacAddr ¶
func HttpGetWithTimeout ¶
func PrintRequest ¶
func PrintResponse ¶
func StringInSlice ¶
func TruncateString ¶
Types ¶
type AtomBool ¶
type AtomBool struct {
// contains filtered or unexported fields
}
AtomBool is a thread safe atomic boolean
type IPInfo ¶
type IPInfo struct {
Address string `json:"address"`
Source string `json:"source"`
IsFallback bool `json:"is_fallback"`
HasCity bool `json:"has_city"`
City struct {
GeoNameID uint `json:"geoname_id"`
Names map[string]string `json:"names"`
} `json:"city"`
Continent struct {
Code string `json:"code"`
GeoNameID uint `json:"geoname_id"`
Names map[string]string `json:"names"`
} `json:"continent"`
Country struct {
GeoNameID uint `json:"geoname_id"`
IsInEuropeanUnion bool `json:"is_in_european_union"`
IsoCode string `json:"iso_code"`
Names map[string]string `json:"names"`
} `json:"country"`
Location struct {
AccuracyRadius uint16 `json:"accuracy_radius"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
MetroCode uint `json:"metro_code"`
TimeZone string `json:"time_zone"`
} `json:"location"`
Postal struct {
Code string `json:"code"`
} `json:"postal"`
RegisteredCountry struct {
GeoNameID uint `json:"geoname_id"`
IsInEuropeanUnion bool `json:"is_in_european_union"`
IsoCode string `json:"iso_code"`
Names map[string]string `json:"names"`
} `json:"registered_country"`
RepresentedCountry struct {
GeoNameID uint `json:"geoname_id"`
IsInEuropeanUnion bool `json:"is_in_european_union"`
IsoCode string `json:"iso_code"`
Names map[string]string `json:"names"`
Type string `json:"type"`
} `json:"represented_country"`
Subdivisions []struct {
GeoNameID uint `json:"geoname_id"`
IsoCode string `json:"iso_code"`
Names map[string]string `json:"names"`
} `json:"subdivisions"`
Traits struct {
IsAnonymousProxy bool `json:"is_anonymous_proxy"`
IsSatelliteProvider bool `json:"is_satellite_provider"`
} `json:"traits"`
HasASN bool `json:"has_asn"`
ASN struct {
AutonomousSystemNumber uint `json:"autonomous_system_number"`
AutonomousSystemOrganization string `json:"autonomous_system_organization"`
} `json:"asn"`
HasAnonymousIP bool `json:"has_anonymous_ip"`
AnonymousIP struct {
IsAnonymous bool `json:"is_anonymous"`
IsAnonymousVPN bool `json:"is_anonymous_vpn"`
IsHostingProvider bool `json:"is_hosting_provider"`
IsPublicProxy bool `json:"is_public_proxy"`
IsTorExitNode bool `json:"is_tor_exit_node"`
} `json:"anonymous_ip"`
}
type IoCContainer ¶
func (*IoCContainer) Assign ¶
func (c *IoCContainer) Assign(ctx context.Context, name ObjectID, obj interface{}) error
func (*IoCContainer) Clear ¶
func (c *IoCContainer) Clear(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.