-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limits supported only on linux - don't build other operating systems (#…
…75) * Limits build for linux only - adding a placeholder (returning errors) on different OSs * Bootstrapping limiter only available on linux
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build linux | ||
// +build linux | ||
|
||
package main | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//go:build !linux | ||
// +build !linux | ||
|
||
package limits | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
// NOTE: Placeholder until Windows limits are introduced. | ||
|
||
type Limits struct { | ||
cfg Config | ||
} | ||
|
||
// New creates a new process resource limit with the given configuration. | ||
func New(opts ...Option) (*Limits, error) { | ||
return nil, errors.New("TBD: not implemented") | ||
} | ||
|
||
// LimitProcess will set the resource limits for the process with the given PID. | ||
func (l *Limits) LimitProcess(pid int) error { | ||
return errors.New("TBD: not implemented") | ||
} | ||
|
||
// ListProcesses will return the pids of the processes that were added to the resource limit group. | ||
func (l *Limits) ListProcesses() ([]int, error) { | ||
return nil, errors.New("TBD: not implemented") | ||
} | ||
|
||
// RemoveAllLimits will remove any set resource limits. | ||
func (l *Limits) RemoveAllLimits() error { | ||
return errors.New("TBD: not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build linux | ||
// +build linux | ||
|
||
package limits | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build linux | ||
// +build linux | ||
|
||
package limits | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters