// DefaultStack sets up the default middlewares
192988
func DefaultStack(appInfo AppInfo, lgr Logger, orig http.Handler) http.Handler {
	return alice.New(
		NewRecoveryMW(appInfo.Name, lgr),
		NewAuditMW(appInfo, lgr),
		NewProfiler,
		NewHealthChecksMW(appInfo.BasePath),
		GzipMW(DefaultCompression),
	).Then(orig)
}
810893
func (actor Actor) GetStack(guid string) (Stack, Warnings, error) {
	stack, warnings, err := actor.CloudControllerClient.GetStack(guid)

	if _, ok := err.(ccerror.ResourceNotFoundError); ok {
		return Stack{}, Warnings(warnings), actionerror.StackNotFoundError{GUID: guid}
	}

	return Stack(stack), Warnings(warnings), err
}
166415
func RegisterStackDumper() {
	go func() {
		sigs := make(chan os.Signal, 1)
		signal.Notify(sigs, syscall.SIGUSR1)
		for {
			<-sigs
			LogStack()
		}
	}()
}
297001
func ExposeStackTrace(err error) error {
	if err == nil {
		return err
	}

	st, ok := getStackTracer(err)
	if !ok {
		return err
	}

	return &withStack{
		err: err,
		st:  st,
	}
}
81355
func (s *Layer) GetStack() []plugin.Plugin {
	s.mtx.RLock()
	defer s.mtx.RUnlock()
	return s.stack
}
1175029
func DefaultUpdateStrategy() *UpdateStrategy {
	return &UpdateStrategy{
		Stagger:          timeToPtr(30 * time.Second),
		MaxParallel:      intToPtr(1),
		HealthCheck:      stringToPtr("checks"),
		MinHealthyTime:   timeToPtr(10 * time.Second),
		HealthyDeadline:  timeToPtr(5 * time.Minute),
		ProgressDeadline: timeToPtr(10 * time.Minute),
		AutoRevert:       boolToPtr(false),
		Canary:           intToPtr(0),
	}
}
1151523
func (s *ActivityTypeConfiguration) SetDefaultTaskHeartbeatTimeout(v string) *ActivityTypeConfiguration {
	s.DefaultTaskHeartbeatTimeout = &v
	return s
}
554981
func NewWithStacks(format string, a ...interface{}) error {
	return &ErrorWithStacks{
		Err:    errors.New(errorPrintf(format, a...)),
		Stacks: stacks(2),
	}
}
1194437
func DefaultStacktracePred(status int) bool {
	return (status < http.StatusOK || status >= http.StatusInternalServerError) && status != http.StatusSwitchingProtocols
}
506332
func (s *UpdateStackOutput) SetStack(v *Stack) *UpdateStackOutput {
	s.Stack = v
	return s
}
856022
func InlineStack(dwarf *dwarf.Data, fnoff dwarf.Offset, pc RelAddr) *InlineStackReader {
	reader := dwarf.Reader()
	reader.Seek(fnoff)
	return &InlineStackReader{dwarf: dwarf, reader: reader, entry: nil, depth: 0, pc: uint64(pc)}
}
1262393
func (m *Mux) SetStack(stack []plugin.Plugin) {
	m.Middleware.SetStack(stack)
}
455655
func Default(devMode ...bool) *Logger {
	if len(devMode) > 0 && devMode[0] {
		std.SetLogConsume(developmentConsume)
	}
	return std
}
1167939
func CreateStack(createRequest StackCreateRequest) (Stack, error) {
	url := "stack/"
	request := "POST"
	var response Stack

	newStack, err := json.Marshal(createRequest)
	if err != nil {
		return response, err
	}

	log.Println(string(newStack))

	data, err := TutumCall(url, request, newStack)
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return response, err
	}

	return response, nil
}
810968
func (s *Scheduler) executeStackUpdate(input *updateStackInput) error {
	stack, err := s.stack(input.StackName)
	if err != nil {
		return err
	}

	i := &cloudformation.UpdateStackInput{
		StackName:  input.StackName,
		Parameters: updateParameters(input.Parameters, stack, input.Template),
		Tags:       input.Tags,
	}
	if input.Template != nil {
		i.TemplateURL = input.Template.URL
	} else {
		i.UsePreviousTemplate = aws.Bool(true)
	}

	_, err = s.cloudformation.UpdateStack(i)
	if err != nil {
		if err, ok := err.(awserr.Error); ok {
			if err.Code() == "ValidationError" && err.Message() == "No updates are to be performed." {
				return nil
			}
		}

		return fmt.Errorf("error updating stack: %v", err)
	}

	return nil
}
1370549
func defaultTransport() *http.Transport {
	transport := defaultPooledTransport()
	transport.DisableKeepAlives = true
	transport.MaxIdleConnsPerHost = -1
	return transport
}
860008
func pushStack(fromSel *Selection, nodes []*html.Node) *Selection {
	result := &Selection{nodes, fromSel.document, fromSel}
	return result
}