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: gateway.go
    path of file: ./repos/shellhub/api/pkg/gateway
    
    the code of the file until where you have to start completion: // Package gateway contains information about who is acting at ShellHub's system.
// The package is used in routes to perform evaluations and transferring information to the services.
//
// Gateway's package also has information ab
    
func IDFromContext(ctx context.Context) *models.ID {
	if c, ok := ctx.Value("ctx").(*Context); ok {
		ID := c.ID()
		if ID == nil {
			if value, ok := ctx.Value("ID").(string); ok {
				ID = &models.ID{value}
			}
		}

		return ID
	}

	return nil
}