server

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCK_SUFFIX = "/lock"
)

Variables

This section is empty.

Functions

func ParseTfName

func ParseTfName(credhubName string) string

Types

type ApiController

type ApiController struct {
	// contains filtered or unexported fields
}

func NewApiController

func NewApiController(basePath string, credhubClient credhub.CredhubClient, storer storer.Storer, store *LockStore) *ApiController

func (ApiController) CredhubName

func (c ApiController) CredhubName(req *http.Request) string

func (ApiController) Delete

func (c ApiController) Delete(w http.ResponseWriter, req *http.Request)

func (ApiController) List

func (c ApiController) List(w http.ResponseWriter, req *http.Request)

func (ApiController) Lock

func (c ApiController) Lock(w http.ResponseWriter, req *http.Request)

func (ApiController) RequestName

func (c ApiController) RequestName(req *http.Request) string

func (ApiController) Retrieve

func (c ApiController) Retrieve(w http.ResponseWriter, req *http.Request)

func (ApiController) Store

func (c ApiController) Store(w http.ResponseWriter, req *http.Request)

func (ApiController) UnLock

func (c ApiController) UnLock(w http.ResponseWriter, req *http.Request)

type CEFMiddleware added in v1.2.0

type CEFMiddleware struct {
	// contains filtered or unexported fields
}

func NewCEFMiddleware added in v1.2.0

func NewCEFMiddleware(w io.Writer, version string) *CEFMiddleware

func (CEFMiddleware) Middleware added in v1.2.0

func (h CEFMiddleware) Middleware(next http.Handler) http.Handler

type CredModel

type CredModel struct {
	CredhubName      string `json:"credhub_name"`
	Name             string `json:"name"`
	VersionCreatedAt string `json:"version_created_at" yaml:"version_created_at"`
	IsLocked         bool   `json:"is_locked"`
	CurrentLockId    string `json:"current_lock_id,omitempty"`
}

type LockStore

type LockStore struct {
	// contains filtered or unexported fields
}

func NewLockStore

func NewLockStore(credhubClient credhub.CredhubClient) *LockStore

func (LockStore) DeleteLock

func (s LockStore) DeleteLock(path string) error

func (LockStore) IsLocked

func (s LockStore) IsLocked(path string) (*state.LockInfo, bool)

func (LockStore) Lock

func (s LockStore) Lock(path string, info *state.LockInfo) error

func (LockStore) UnLock

func (s LockStore) UnLock(path string, info *state.LockInfo) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewCloudServer

func NewCloudServer(version string) (*Server, error)

func NewServer

func NewServer(version string, config *ServerConfig) (*Server, error)

func (Server) CreateCredhubCli

func (s Server) CreateCredhubCli() (cclient.CredhubClient, error)

func (*Server) Load

func (s *Server) Load() error

func (Server) Run

func (s Server) Run() error

type ServerConfig

type ServerConfig struct {
	Host               string   `json:"host" yaml:"host"`
	BasePath           string   `json:"base_path" yaml:"base_path"`
	ChunkSize          int64    `json:"chunk_size" yaml:"chunk_size"`
	Port               int      `json:"port" yaml:"port"`
	Cert               string   `json:"cert" yaml:"cert" cloud-default:"server.crt"`
	Key                string   `json:"key" yaml:"key" cloud-default:"server.key"`
	LogLevel           string   `json:"log_level" yaml:"log_level" cloud-default:"info"`
	LogJson            bool     `json:"log_json" yaml:"log_json"`
	NoColor            bool     `json:"no_color" yaml:"no_color"`
	LetsEncryptDomains []string `json:"lets_encrypt_domains" yaml:"lets_encrypt_domains"`
	Username           string   `json:"username" yaml:"username"`
	Password           string   `json:"password" yaml:"password"`
	CredhubServer      string   `json:"credhub_server" yaml:"credhub_server"`
	CredhubUsername    string   `json:"credhub_username" yaml:"credhub_username"`
	CredhubPassword    string   `json:"credhub_password" yaml:"credhub_password"`
	CredhubClient      string   `json:"credhub_client" yaml:"credhub_client"`
	CredhubSecret      string   `json:"credhub_secret" yaml:"credhub_secret"`
	CredhubCaCert      string   `json:"credhub_ca_cert" yaml:"credhub_ca_cert"`
	SkipSslValidation  bool     `json:"skip_ssl_validation" yaml:"skip_ssl_validation"`
	ShowError          bool     `json:"show_error" yaml:"show_error"`
	CEF                bool     `json:"cef" yaml:"cef"`
	CEFFile            string   `json:"cef-file" yaml:"cef-file"`
	AuthUrl            string   `json:"auth-url" yaml:"auth-url"`
	DryRun             bool     `json:"dry-run" yaml:"dry-run"`
}

Directories

Path Synopsis
credhubfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
storerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL