Coder Social home page Coder Social logo

tsipinakis / libcontainerssh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from containerssh/libcontainerssh

0.0 0.0 0.0 4.46 MB

Embedded ContainerSSH and webhook helper library

License: Other

Go 99.39% Gherkin 0.22% HTML 0.17% Dockerfile 0.09% Shell 0.13%

libcontainerssh's Introduction

ContainerSSH - Launch Containers on Demand

libcontainerssh

This library is the core library of ContainerSSH and simultaneously serves as a library to integrate with ContainerSSH. This readme outlines the basics of using this library, for more detailed documentation please head to containerssh.io.

Embedding ContainerSSH

You can fully embed ContainerSSH into your own application. First, you will need to create the configuration structure:

cfg := config.AppConfig{}

You can then populate this config with your options and create a ContainerSSH instance like this:

 pool, lifecycle, err := containerssh.New(cfg, loggerFactory)
 if err != nil {
     return err
 }

You will receive a service pool and a lifecycle as a response. You can use these to start the service pool of ContainerSSH. This will block execution until ContainerSSH stops.

err := lifecycle.Run()

This will run ContainerSSH in the current Goroutine. You can also use the lifecycle to add hooks to lifecycle states of ContainerSSH. You must do this before you call Run(). For example:

lifecycle.OnStarting(
    func(s service.Service, l service.Lifecycle) {
        print("ContainerSSH is starting...")
    },
)

You can also have ContainerSSH stop gracefully by using the Stop() function on the lifecycle. This takes a context as an argument, which is taken as a timeout for the graceful shutdown.

Building an authentication webhook server

Building a configuration webhook server

Building a combined configuration-authentication webhook server

Reading audit logs

libcontainerssh's People

Contributors

bencurio avatar dependabot[bot] avatar janosdebugs avatar mhmxs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.