github.com/gofiber/fiber/v2@v2.47.0/internal/gopsutil/net/net_fallback.go (about) 1 //go:build !aix && !darwin && !linux && !freebsd && !openbsd && !windows 2 // +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows 3 4 package net 5 6 import ( 7 "context" 8 9 "github.com/gofiber/fiber/v2/internal/gopsutil/common" 10 ) 11 12 func IOCounters(pernic bool) ([]IOCountersStat, error) { 13 return IOCountersWithContext(context.Background(), pernic) 14 } 15 16 func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { 17 return []IOCountersStat{}, common.ErrNotImplementedError 18 } 19 20 func FilterCounters() ([]FilterStat, error) { 21 return FilterCountersWithContext(context.Background()) 22 } 23 24 func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { 25 return []FilterStat{}, common.ErrNotImplementedError 26 } 27 28 func ConntrackStats(percpu bool) ([]ConntrackStat, error) { 29 return ConntrackStatsWithContext(context.Background(), percpu) 30 } 31 32 func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) { 33 return nil, common.ErrNotImplementedError 34 } 35 36 func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { 37 return ProtoCountersWithContext(context.Background(), protocols) 38 } 39 40 func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { 41 return []ProtoCountersStat{}, common.ErrNotImplementedError 42 } 43 44 func Connections(kind string) ([]ConnectionStat, error) { 45 return ConnectionsWithContext(context.Background(), kind) 46 } 47 48 func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) { 49 return []ConnectionStat{}, common.ErrNotImplementedError 50 } 51 52 func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) { 53 return ConnectionsMaxWithContext(context.Background(), kind, max) 54 } 55 56 func ConnectionsMaxWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) { 57 return []ConnectionStat{}, common.ErrNotImplementedError 58 } 59 60 // Return a list of network connections opened, omitting `Uids`. 61 // WithoutUids functions are reliant on implementation details. They may be altered to be an alias for Connections or be 62 // removed from the API in the future. 63 func ConnectionsWithoutUids(kind string) ([]ConnectionStat, error) { 64 return ConnectionsWithoutUidsWithContext(context.Background(), kind) 65 } 66 67 func ConnectionsWithoutUidsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) { 68 return ConnectionsMaxWithoutUidsWithContext(ctx, kind, 0) 69 } 70 71 func ConnectionsMaxWithoutUidsWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) { 72 return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, 0, max) 73 } 74 75 func ConnectionsPidWithoutUids(kind string, pid int32) ([]ConnectionStat, error) { 76 return ConnectionsPidWithoutUidsWithContext(context.Background(), kind, pid) 77 } 78 79 func ConnectionsPidWithoutUidsWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) { 80 return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, 0) 81 } 82 83 func ConnectionsPidMaxWithoutUids(kind string, pid int32, max int) ([]ConnectionStat, error) { 84 return ConnectionsPidMaxWithoutUidsWithContext(context.Background(), kind, pid, max) 85 } 86 87 func ConnectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) { 88 return connectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, max) 89 } 90 91 func connectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) { 92 return []ConnectionStat{}, common.ErrNotImplementedError 93 }