mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			453 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			453 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package api
 | 
						|
 | 
						|
import (
 | 
						|
	"context"
 | 
						|
	"net/http"
 | 
						|
)
 | 
						|
 | 
						|
func (c *Sys) StepDown() error {
 | 
						|
	return c.StepDownWithContext(context.Background())
 | 
						|
}
 | 
						|
 | 
						|
func (c *Sys) StepDownWithContext(ctx context.Context) error {
 | 
						|
	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx)
 | 
						|
	defer cancelFunc()
 | 
						|
 | 
						|
	r := c.c.NewRequest(http.MethodPut, "/v1/sys/step-down")
 | 
						|
 | 
						|
	resp, err := c.c.rawRequestWithContext(ctx, r)
 | 
						|
	if resp != nil && resp.Body != nil {
 | 
						|
		resp.Body.Close()
 | 
						|
	}
 | 
						|
	return err
 | 
						|
}
 |