// SetHook set hook for logging action
5624
func SetHook(hook Hook) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetHook(hook)
}
558699
func (s *RedirectActionConfig) SetHost(v string) *RedirectActionConfig {
	s.Host = &v
	return s
}
721349
func (c *Client) SetHeader(key, value string) {
	c.headers[key] = value
}
1038179
func (n *Node) RegisterSelfEvictHook(hooks SelfEvictHook) error {
	return n.selfEvict.RegisterSelfEvictHook(hooks)
}
323869
func (w *FileLogWriter) SetHeadFoot(head, foot string) *FileLogWriter {
	w.header, w.trailer = head, foot
	if w.maxlines_curlines == 0 {
		fmt.Fprint(w.file, FormatLogRecord(w.header, &LogRecord{Created: time.Now()}))
	}
	return w
}
983374
func (w *WebHookHandler) ProcessWebHook(writer http.ResponseWriter, req *http.Request, ctx context.Context, name, subpath string) error {
	parts := strings.Split(strings.TrimPrefix(subpath, "/"), "/")
	if len(parts) != 2 {
		return errors.NewBadRequest(fmt.Sprintf("unexpected hook subpath %s", subpath))
	}
	secret, hookType := parts[0], parts[1]

	plugin, ok := w.plugins[hookType]
	if !ok {
		return errors.NewNotFound(build.Resource("buildconfighook"), hookType)
	}

	config, err := w.buildConfigClient.BuildConfigs(apirequest.NamespaceValue(ctx)).Get(name, metav1.GetOptions{})
	if err != nil {
		// clients should not be able to find information about build configs in
		// the system unless the config exists and the secret matches
		return errors.NewUnauthorized(fmt.Sprintf("the webhook %q for %q did not accept your secret", hookType, name))
	}

	triggers, err := plugin.GetTriggers(config)
	if err != nil {
		return errors.NewUnauthorized(fmt.Sprintf("the webhook %q for %q did not accept your secret", hookType, name))
	}

	klog.V(4).Infof("checking secret for %q webhook trigger of buildconfig %s/%s", hookType, config.Namespace, config.Name)
	trigger, err := webhook.CheckSecret(config.Namespace, secret, triggers, w.secretsClient)
	if err != nil {
		return errors.NewUnauthorized(fmt.Sprintf("the webhook %q for %q did not accept your secret", hookType, name))
	}

	revision, envvars, dockerStrategyOptions, proceed, err := plugin.Extract(config, trigger, req)
	if !proceed {
		switch err {
		case webhook.ErrSecretMismatch, webhook.ErrHookNotEnabled:
			return errors.NewUnauthorized(fmt.Sprintf("the webhook %q for %q did not accept your secret", hookType, name))
		case webhook.MethodNotSupported:
			return errors.NewMethodNotSupported(build.Resource("buildconfighook"), req.Method)
		}
		if _, ok := err.(*errors.StatusError); !ok && err != nil {
			return errors.NewInternalError(fmt.Errorf("hook failed: %v", err))
		}
		return err
	}
	warning := err

	buildTriggerCauses := webhook.GenerateBuildTriggerInfo(revision, hookType)

	request := &buildv1.BuildRequest{
		TriggeredBy:           buildTriggerCauses,
		ObjectMeta:            metav1.ObjectMeta{Name: name},
		Revision:              revision,
		Env:                   envvars,
		DockerStrategyOptions: dockerStrategyOptions,
	}

	newBuild, err := w.instantiator.Instantiate(config.Namespace, request)
	if err != nil {
		return errors.NewInternalError(fmt.Errorf("could not generate a build: %v", err))
	}

	// Send back the build name so that the client can alert the user.
	if newBuildEncoded, err := runtime.Encode(webhookEncodingCodecFactory.LegacyCodec(w.groupVersion), newBuild); err != nil {
		utilruntime.HandleError(err)
	} else {
		writer.Write(newBuildEncoded)
	}

	return warning
}
373062
func handleHook(a HookAction, err error) {
	if err != nil {
		// TODO: handle errors
	}

	switch a {
	case HookActionContinue:
		return
	case HookActionHalt:
		panic(HookActionHalt)
	}
}
431249
func (s *CreateServerInput) SetHostKey(v string) *CreateServerInput {
	s.HostKey = &v
	return s
}
1200370
func (s *Volume) SetHost(v *HostVolumeProperties) *Volume {
	s.Host = v
	return s
}
376575
func LogHandler(h http.Handler, opts *LogOptions) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		if _, ok := getStatusWriter(w); ok {
			// Self-awareness, logging handler already set up
			h.ServeHTTP(w, r)
			return
		}

		// Save the response start time
		st := time.Now()
		// Call the wrapped handler, with the augmented ResponseWriter to handle the status code
		stw := &statusResponseWriter{w, 0, ""}

		// Log immediately if requested, otherwise on exit
		if opts.Immediate {
			logRequest(stw, r, st, opts)
		} else {
			// Store original URL, may get modified by handlers (i.e. StripPrefix)
			stw.oriURL = r.URL.String()
			defer logRequest(stw, r, st, opts)
		}
		h.ServeHTTP(stw, r)
	}
}
260270
func (s *SamplingRule) SetHost(v string) *SamplingRule {
	s.Host = &v
	return s
}
37141
func (t *ETagConfig) SetHashFunc(hashFunc ETagHashFunc) *ETagConfig {
	t.HashFunc = hashFunc
	return t
}
42467
func (s *CreateHostedZoneOutput) SetHostedZone(v *HostedZone) *CreateHostedZoneOutput {
	s.HostedZone = v
	return s
}
92250
func SetHandler(re *regexp.Regexp, handler Handler) {
	DefaultLoggerCollection.SetHandler(re, handler)
}
586684
func (s *GetHostedZoneCountOutput) SetHostedZoneCount(v int64) *GetHostedZoneCountOutput {
	s.HostedZoneCount = &v
	return s
}
1281686
func deleteWebhook(bean *Webhook) (err error) {
	sess := x.NewSession()
	defer sess.Close()
	if err = sess.Begin(); err != nil {
		return err
	}

	if _, err = sess.Delete(bean); err != nil {
		return err
	} else if _, err = sess.Delete(&HookTask{HookID: bean.ID}); err != nil {
		return err
	}

	return sess.Commit()
}
1013008
func SetHookAsync(async bool) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetHookAsync(async)
}