spacelet

package
v0.0.0-...-1ae172a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// kubespace服务地址
	ServerUrl string
	Client    *httpclient.HttpClient
	// spacelet所在服务器的主机ip
	HostIp string
	// spacelet服务启动端口
	Port int
	// 执行流水线任务的数据目录
	DataDir string
	// 注册之后获取的token,用来进行认证
	Token string
}

func NewConfig

func NewConfig(options *Options) (*Config, error)

type ExecRequest

type ExecRequest struct {
	Command    string `json:"command"`
	Executable string `json:"executable"`
}

type ExecResponse

type ExecResponse struct {
	Status int
	Stderr string
	Stdin  string
	Stdout string
}

type Options

type Options struct {
	HostIp    string
	Port      int
	DataDir   string
	ServerUrl string
}

type RegisterRequest

type RegisterRequest struct {
	Hostname string `json:"hostname"`
	HostIp   string `json:"hostip"`
	Port     int    `json:"port"`
}

type RegisterToken

type RegisterToken struct {
	Token string `json:"token"`
}

type Server

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

func NewServer

func NewServer(config *Config) (*Server, error)

func (*Server) AuthMiddleware

func (s *Server) AuthMiddleware() gin.HandlerFunc

AuthMiddleware 调用spacelet接口需要通过token认证

func (*Server) Exec

func (s *Server) Exec(c *gin.Context)

func (*Server) Register

func (s *Server) Register() error

Register 启动spacelet后进行注册

func (*Server) Run

func (s *Server) Run()

func (*Server) Token

func (s *Server) Token(c *gin.Context)

Token 注册时kubespace server会调用该接口配置token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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