github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/engine/systemd/systemd.go (about)

     1  package systemd
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/projecteru2/core/engine"
     7  	"github.com/projecteru2/core/engine/docker"
     8  	coretypes "github.com/projecteru2/core/types"
     9  )
    10  
    11  // TCPPrefix is engine endpoint prefix
    12  const TCPPrefix = "systemd://"
    13  
    14  // Engine is engine for systemd
    15  type Engine struct {
    16  	engine.API
    17  	config coretypes.Config
    18  }
    19  
    20  // MakeClient make systemd cli
    21  func MakeClient(ctx context.Context, config coretypes.Config, nodename, endpoint, ca, cert, key string) (engine.API, error) {
    22  	api, err := docker.MakeClient(ctx, config, nodename, endpoint, ca, cert, key)
    23  	if err != nil {
    24  		return nil, err
    25  	}
    26  	return &Engine{
    27  		API:    api,
    28  		config: config,
    29  	}, nil
    30  }