// clearActionFunc first enumerates, then changes Cleared flag to true,
// then updates it.
// Raise method determines if ttlOption needs to be applied based on clear flag.
327353
func clearActionFunc(manager Manager, filters ...Filter) error {
	myAlerts, err := manager.Enumerate(filters...)
	if err != nil {
		return err
	}

	for _, myAlert := range myAlerts {
		myAlert.Cleared = true
		if err := manager.Raise(myAlert); err != nil {
			return err
		}
	}

	return nil
}
123945
func SetValidationFunc(name string, vf ValidationFunc) error {
	return defaultValidator.SetValidationFunc(name, vf)
}
277460
func removeObjectActions(statement Statement, objectResource string) Statement {
	if statement.Conditions == nil {
		if len(statement.Resources) > 1 {
			statement.Resources.Remove(objectResource)
		} else {
			statement.Actions = statement.Actions.Difference(readOnlyObjectActions)
			statement.Actions = statement.Actions.Difference(writeOnlyObjectActions)
		}
	}

	return statement
}
139558
func (s *BlueInstanceTerminationOption) SetAction(v string) *BlueInstanceTerminationOption {
	s.Action = &v
	return s
}
1131471
func WrapAction(action cli.ActionFunc) cli.ActionFunc {
	if action == nil {
		return nil
	}

	return func(c *cli.Context) (err error) {
		if err = action(c); err != nil {
			switch err.(type) {
			case cli.ExitCoder:
				return
			default:
				var message string
				formatter := errutil.NewConsoleFormatter("; ")
				if message, err = formatter.FormatSkip(err, 1); err != nil {
					panic(err)
				}
				return cli.Exit(message, 1)
			}
		}
		return
	}
}
982800
func (s *TcpRoute) SetAction(v *TcpRouteAction) *TcpRoute {
	s.Action = v
	return s
}
461752
func FilterAction(methodRef interface{}) FilterConfigurator {
	var (
		methodValue = reflect.ValueOf(methodRef)
		methodType  = methodValue.Type()
	)
	if methodType.Kind() != reflect.Func || methodType.NumIn() == 0 {
		panic("Expecting a controller method reference (e.g. Controller.Action), got a " +
			methodType.String())
	}

	controllerType := methodType.In(0)
	method := FindMethod(controllerType, methodValue)
	if method == nil {
		panic("Action not found on controller " + controllerType.Name())
	}

	for controllerType.Kind() == reflect.Ptr {
		controllerType = controllerType.Elem()
	}

	return newFilterConfigurator(controllerType.Name(), method.Name)
}
404061
func (m *Machine) CancelAction(action Action) (Action, error) {
	return action.Finish(ActionResults{Status: ActionCancelled})
}
1335376
func (c *Client) ClearToken() {
	c.modifyLock.Lock()
	defer c.modifyLock.Unlock()

	c.token = ""
}
795630
func RemoveAction(arguments string, config *rspec.LinuxSeccomp) error {
	if config == nil {
		return fmt.Errorf("Cannot remove action from nil Seccomp pointer")
	}

	syscallsToRemove := strings.Split(arguments, ",")

	for counter, syscallStruct := range config.Syscalls {
		if reflect.DeepEqual(syscallsToRemove, syscallStruct.Names) {
			config.Syscalls = append(config.Syscalls[:counter], config.Syscalls[counter+1:]...)
		}
	}

	return nil
}
153867
func (s *BaiduMessage) SetAction(v string) *BaiduMessage {
	s.Action = &v
	return s
}
1345927
func (s *SingletonLoader) clearFuture(id loader.PluginID, f *future) {
	s.instanceLock.Lock()
	defer s.instanceLock.Unlock()
	if f.equal(s.instances[id]) {
		delete(s.instances, id)
	}
}
1175341
func (s *RuleGroupUpdate) SetAction(v string) *RuleGroupUpdate {
	s.Action = &v
	return s
}
865948
func WithIgnoreFunc(fn func(err error, fields map[string]string) bool) OptionFunc {
	return func(h *Hook) {
		h.ignoreFunc = fn
	}
}
1294466
func HandleAction(action interface{}, context *Context) (err error) {
	switch a := action.(type) {
	case ActionFunc:
		return a(context)
	case func(*Context) error:
		return a(context)
	case func(*Context): // deprecated function signature
		a(context)
		return nil
	}

	return errInvalidActionType
}
94174
func (rl *ReqLog) ClearInactive() {
	rl.lock.Lock()
	defer rl.lock.Unlock()

	k := rl.keep
	rl.keep = 0
	rl.cleanup()
	rl.keep = k
}
772574
func actionDecorator(f func(*cli.Context) error) func(*cli.Context) error {
	return func(c *cli.Context) error {
		if err := f(c); err != nil {
			s, ok := status.FromError(err)

			// If it's a command for the UnlockerService (like
			// 'create' or 'unlock') but the wallet is already
			// unlocked, then these methods aren't recognized any
			// more because this service is shut down after
			// successful unlock. That's why the code
			// 'Unimplemented' means something different for these
			// two commands.
			if s.Code() == codes.Unimplemented &&
				(c.Command.Name == "create" ||
					c.Command.Name == "unlock") {
				return fmt.Errorf("Wallet is already unlocked")
			}

			// lnd might be active, but not possible to contact
			// using RPC if the wallet is encrypted. If we get
			// error code Unimplemented, it means that lnd is
			// running, but the RPC server is not active yet (only
			// WalletUnlocker server active) and most likely this
			// is because of an encrypted wallet.
			if ok && s.Code() == codes.Unimplemented {
				return fmt.Errorf("Wallet is encrypted. " +
					"Please unlock using 'lncli unlock', " +
					"or set password using 'lncli create'" +
					" if this is the first time starting " +
					"lnd.")
			}
			return err
		}
		return nil
	}
}