Documentation ¶
Index ¶
- Variables
- func AuthenticateClientJWT(w http.ResponseWriter, r *http.Request)
- func CreateOrUpdateDeployment(w http.ResponseWriter, r *http.Request)
- func CreateOrUpdateSecret(w http.ResponseWriter, r *http.Request)
- func CreateSession(w http.ResponseWriter, r *http.Request)
- func DeleteDeployment(w http.ResponseWriter, r *http.Request)
- func DeleteSecret(w http.ResponseWriter, r *http.Request)
- func DeleteSession(w http.ResponseWriter, r *http.Request)
- func GetAllDeployments(w http.ResponseWriter, _ *http.Request)
- func GetDeployment(w http.ResponseWriter, r *http.Request)
- func GetDeploymentContainers(w http.ResponseWriter, r *http.Request)
- func GetJobByID(w http.ResponseWriter, r *http.Request)
- func GetJobsByDaysAgo(w http.ResponseWriter, r *http.Request)
- func GetJobsByDeployment(w http.ResponseWriter, r *http.Request)
- func GetSecrets(w http.ResponseWriter, r *http.Request)
- func GetSessions(w http.ResponseWriter, _ *http.Request)
- func HealthCheck(w http.ResponseWriter, r *http.Request)
- func RequestLoginPhrase(w http.ResponseWriter, _ *http.Request)
- func RestartDeploymentContainers(w http.ResponseWriter, r *http.Request)
- func RootPath(w http.ResponseWriter, _ *http.Request)
- func RunDeployment(w http.ResponseWriter, r *http.Request)
- func StartDeploymentContainers(w http.ResponseWriter, r *http.Request)
- func StopDeploymentContainers(w http.ResponseWriter, r *http.Request)
- func SubscribeToContainerLogs(w http.ResponseWriter, r *http.Request)
- func SubscribeToDeploymentEvents(w http.ResponseWriter, r *http.Request)
- func SubscribeToDeploymentLogs(w http.ResponseWriter, r *http.Request)
- type AuthRequest
- type LoginResponse
Constants ¶
This section is empty.
Variables ¶
var WSUpgrader = websocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { s := r.Context().Value("session").(session.Session) if !s.IsValid() { return false } return true }, }
WSUpgrader upgrades HTTP connections to WebSocket connections
Functions ¶
func AuthenticateClientJWT ¶
func AuthenticateClientJWT(w http.ResponseWriter, r *http.Request)
AuthenticateClientJWT authenticates a client signed jwt token. This usually gets called after a call to /login. The login route returns a server phrase which is signed using the clients private auth. To authenticate the clients signed token this route is called and the token is validated against the clients public auth on the host machine.
func CreateOrUpdateDeployment ¶
func CreateOrUpdateDeployment(w http.ResponseWriter, r *http.Request)
CreateOrUpdateDeployment saves a deployment configuration
func CreateOrUpdateSecret ¶
func CreateOrUpdateSecret(w http.ResponseWriter, r *http.Request)
CreateOrUpdateSecret saves a deployment secret
func CreateSession ¶
func CreateSession(w http.ResponseWriter, r *http.Request)
CreateSession returns a session with an active access token. Access tokens are useful for CI
func DeleteDeployment ¶
func DeleteDeployment(w http.ResponseWriter, r *http.Request)
DeleteDeployment deletes a deployments container resources and configuration
func DeleteSecret ¶
func DeleteSecret(w http.ResponseWriter, r *http.Request)
DeleteSecret removes a deployment secret
func DeleteSession ¶
func DeleteSession(w http.ResponseWriter, r *http.Request)
DeleteSession will delete a session revoking any further request using that session token
func GetAllDeployments ¶
func GetAllDeployments(w http.ResponseWriter, _ *http.Request)
GetAllDeployments returns a list of deployments with their configurations, containers and recent activity
func GetDeployment ¶
func GetDeployment(w http.ResponseWriter, r *http.Request)
GetDeployment returns a deployments and it configuration, containers and recent activity
func GetDeploymentContainers ¶
func GetDeploymentContainers(w http.ResponseWriter, r *http.Request)
GetDeploymentContainers returns all containers for a deployment
func GetJobByID ¶
func GetJobByID(w http.ResponseWriter, r *http.Request)
GetJobByID returns a job by id
func GetJobsByDaysAgo ¶
func GetJobsByDaysAgo(w http.ResponseWriter, r *http.Request)
GetJobsByDaysAgo returns all deployment jobs within a date range (default is `7` days ago)
func GetJobsByDeployment ¶
func GetJobsByDeployment(w http.ResponseWriter, r *http.Request)
GetJobsByDeployment returns all jobs within a date range (default is 7d ago)
func GetSecrets ¶
func GetSecrets(w http.ResponseWriter, r *http.Request)
GetSecrets returns all secrets for a deployment
func GetSessions ¶
func GetSessions(w http.ResponseWriter, _ *http.Request)
GetSessions returns a list of user sessions. A session is an authenticated client with a valid access token
func HealthCheck ¶
func HealthCheck(w http.ResponseWriter, r *http.Request)
HealthCheck returns the health and status of the running Krane instance
func RequestLoginPhrase ¶
func RequestLoginPhrase(w http.ResponseWriter, _ *http.Request)
RequestLoginPhrase request a preliminary login request for authentication with the krane server. This will return a request id and phrase. The phrase should be encrypted using the clients private key. This route does not return a token. You must use /auth and provide the signed phrase.
func RestartDeploymentContainers ¶
func RestartDeploymentContainers(w http.ResponseWriter, r *http.Request)
RestartDeploymentContainers re-creates all containers for a deployment Note: this is the same as calling /deployments/{deployment} since both re-create container resources
func RootPath ¶
func RootPath(w http.ResponseWriter, _ *http.Request)
RootPath returns a plain-text response and 200 OK
func RunDeployment ¶
func RunDeployment(w http.ResponseWriter, r *http.Request)
RunDeployment triggers a deployment run creating container resources
func StartDeploymentContainers ¶
func StartDeploymentContainers(w http.ResponseWriter, r *http.Request)
StartDeploymentContainers starts all containers (if any) for a deployment Note: this does not create any containers, only start already existing ones
func StopDeploymentContainers ¶
func StopDeploymentContainers(w http.ResponseWriter, r *http.Request)
StopDeploymentContainers stops all containers (if any) for a deployment Note: this does not create any containers, only stops already existing ones
func SubscribeToContainerLogs ¶
func SubscribeToContainerLogs(w http.ResponseWriter, r *http.Request)
SubscribeToContainerLogs opens a websocket connection and subscribes the client to container logs
func SubscribeToDeploymentEvents ¶
func SubscribeToDeploymentEvents(w http.ResponseWriter, r *http.Request)
SubscribeToDeploymentEvents opens a websocket connection and subscribes the client to deployment events
func SubscribeToDeploymentLogs ¶
func SubscribeToDeploymentLogs(w http.ResponseWriter, r *http.Request)
SubscribeToDeploymentLogs opens a websocket connection and subscribes the client to deployment events
Types ¶
type AuthRequest ¶
type AuthRequest struct { RequestID string `json:"request_id" binding:"required"` Token string `json:"token" binding:"required"` }
AuthRequest represents the payload expected when authenticating with Krane
type LoginResponse ¶
LoginResponse is the response received when you initially want to authenticate. The request_id is a uuid stored for future validation and the phrase is a generated phrased containing that request_id meant to be signed by the clients private key to later be unsigned by the clients public key to establish an authenticated sessions