diff --git a/process.go b/process.go index b3b61c8..30e9e31 100644 --- a/process.go +++ b/process.go @@ -12,28 +12,28 @@ // See the License for the specific language governing permissions and // limitations under the License. -package proc +package process import ( "sync" ) -type Proc struct { +type Process struct { Name string Vrf string Args []string File string } -type ProcList map[string]*Proc +type ProcessList map[string]*Process var ( - ProcVrfMap = map[string]*ProcList{} - ProcMutex sync.RWMutex + ProcessVrfMap = map[string]*ProcessList{} + ProcessMutex sync.RWMutex ) -func NewProc(name string, vrf string, args ...string) *Proc { - proc := &Proc{ +func NewProcess(name string, vrf string, args ...string) *Process { + proc := &Process{ Name: name, Vrf: vrf, Args: []string(args), @@ -41,28 +41,28 @@ func NewProc(name string, vrf string, args ...string) *Proc { return proc } -func ProcRegister(proc *Proc) { - ProcMutex.Lock() - defer ProcMutex.Unlock() +func ProcessRegister(proc *Process) { + ProcessMutex.Lock() + defer ProcessMutex.Unlock() } -func ProcUnregister(proc *Proc) { - ProcMutex.Lock() - defer ProcMutex.Unlock() +func ProcessUnregister(proc *Process) { + ProcessMutex.Lock() + defer ProcessMutex.Unlock() } -func ProcUnregisterByCommand(name string) { - ProcMutex.Lock() - defer ProcMutex.Unlock() +func ProcessUnregisterByCommand(name string) { + ProcessMutex.Lock() + defer ProcessMutex.Unlock() } -func ProcUnregisterByVrf() { - ProcMutex.Lock() - defer ProcMutex.Unlock() +func ProcessUnregisterByVrf() { + ProcessMutex.Lock() + defer ProcessMutex.Unlock() } -func (proc *Proc) Start() { +func (proc *Process) Start() { } -func (proc *Proc) Stop() { +func (proc *Process) Stop() { } diff --git a/proces_test.go b/process_test.go similarity index 84% rename from proces_test.go rename to process_test.go index 16069df..a82a5d7 100644 --- a/proces_test.go +++ b/process_test.go @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package proc +package process import ( "testing" ) -func TestProcStart(t *testing.T) { +func TestProcessStart(t *testing.T) { args := []string{"-d", "-f"} - proc := NewProc("dhcp", "", args...) - ProcRegister(proc) + proc := NewProcess("dhcp", "", args...) + ProcessRegister(proc) }