You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rpc-crackstations.go
    path of file: ./repos/sliver/server/rpc
    
    the code of the file until where you have to start completion: package rpc

/*
	Sliver Implant Framework
	Copyright (C) 2022  Bishop Fox

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

import (
	"contex
    
func (rpc *Server) CrackstationTrigger(ctx context.Context, req *clientpb.Event) (*commonpb.Empty, error) {
	switch req.EventType {

	case consts.CrackStatusEvent:
		statusUpdate := &clientpb.CrackstationStatus{}
		err := proto.Unmarshal(req.Data, statusUpdate)
		if err != nil {
			crackRpcLog.Errorf("Failed to unmarshal crackstation status update: %s", err)
			return nil, status.Errorf(codes.InvalidArgument, "Failed to unmarshal status update")
		}
		crackStation := core.GetCrackstation(statusUpdate.HostUUID)
		if crackStation == nil {
			crackRpcLog.Errorf("Received status update for unknown crackstation: %s", statusUpdate.Name)
			return nil, status.Errorf(codes.InvalidArgument, "Unknown crackstation")
		}
		crackStation.UpdateStatus(statusUpdate)

	}
	return &commonpb.Empty{}, nil
}