mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-27 13:11:58 -08:00
Add 'grumble ctl'.
This commit is contained in:
parent
01182d36b3
commit
41f6af2334
10 changed files with 343 additions and 34 deletions
46
ctlrpc.go
Normal file
46
ctlrpc.go
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2011 The Grumble Authors
|
||||
// The use of this source code is goverened by a BSD-style
|
||||
// license that can be found in the LICENSE-file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
type ControlRPC struct {
|
||||
|
||||
}
|
||||
|
||||
// Start a server
|
||||
func (c *ControlRPC) Start(in *int, out *int) os.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Stop a server
|
||||
func (c *ControlRPC) Stop(in *int, out *int) os.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type ConfigValue struct {
|
||||
Id int64
|
||||
Key string
|
||||
Value string
|
||||
}
|
||||
|
||||
// Set a config value
|
||||
func (c *ControlRPC) SetConfig(in *ConfigValue, out *ConfigValue) os.Error {
|
||||
servers[in.Id].SetConfig(in.Key, in.Value)
|
||||
out.Id = in.Id
|
||||
out.Key = in.Key
|
||||
out.Value = in.Value
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get a config value
|
||||
func (c *ControlRPC) GetConfig(in *ConfigValue, out *ConfigValue) os.Error {
|
||||
out.Id = in.Id
|
||||
out.Key = in.Key
|
||||
out.Value = servers[in.Id].GetConfig(in.Key)
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue