rearrange ctx parameter to match stdlib
This commit is contained in:
parent
8bb696fb51
commit
f9f44604e1
10
README.md
10
README.md
@ -48,13 +48,21 @@ func main() {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// Equivalent to `systemctl enable dhcpd` with a 10 second timeout
|
// Equivalent to `systemctl enable dhcpd` with a 10 second timeout
|
||||||
err := systemctl.Enable("dhcpd", ctx)
|
err := systemctl.Enable(ctx, "dhcpd")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("unable to enable unit %s: %v", "dhcpd", err)
|
log.Fatalf("unable to enable unit %s: %v", "dhcpd", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the 0BSD License, written by [Rob Landley](https://github.com/landley).
|
||||||
|
As such, you may use this library without restriction or attribution, but please don't pass it off as your own.
|
||||||
|
Attribution, though not required, is appreciated.
|
||||||
|
|
||||||
|
By contributing, you agree all code submitted also falls under the License.
|
||||||
|
|
||||||
## External resources
|
## External resources
|
||||||
|
|
||||||
- [Official systemctl documentation](https://www.man7.org/linux/man-pages/man1/systemctl.1.html)
|
- [Official systemctl documentation](https://www.man7.org/linux/man-pages/man1/systemctl.1.html)
|
||||||
|
28
systemctl.go
28
systemctl.go
@ -1,66 +1,68 @@
|
|||||||
package systemctl
|
package systemctl
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func IsFailed(unit string) (bool, error) {
|
func IsFailed(ctx context.Context, unit string) (bool, error) {
|
||||||
|
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func IsActive(unit string) (bool, error) {
|
func IsActive(ctx context.Context, unit string) (bool, error) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Status(unit string) (bool, error) {
|
func Status(ctx context.Context, unit string) (bool, error) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Restart(unit string) error {
|
func Restart(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Start(unit string) error {
|
func Start(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Stop(unit string) error {
|
func Stop(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Enable(unit string) error {
|
func Enable(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func Disable(unit string) error {
|
func Disable(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func IsEnabled(unit string) (bool, error) {
|
func IsEnabled(ctx context.Context, unit string) (bool, error) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func DaemonReload(unit string) error {
|
func DaemonReload(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
func Show(unit string, property string) (string, error) {
|
func Show(ctx context.Context, unit string, property string) (string, error) {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
func Mask(unit string) error {
|
func Mask(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Unmask(unit string) error {
|
func Unmask(ctx context.Context, unit string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user