Documentation
¶
Index ¶
- Constants
- func Folder(dir string) string
- func Own(ctx context.Context) bool
- func Profile(ctx context.Context, cfg *config.Config, name string) (*config.Config, error)
- func Refuse(code connect.Code, err error) *connect.Error
- func Remote(ctx context.Context) bool
- func Routed(ctx context.Context) *config.Config
- func Window(ctx context.Context) string
- func WindowID(ctx context.Context) string
- func Yolo(ctx context.Context) bool
- type Account
- type Health
- type Keeper
- type Limits
- type Notices
- type Problem
- type Registrant
- type Registry
- type Remark
- type Remarker
- type Router
- type Server
- func (s *Server) Accepting(accept func(cfg *config.Config, accept string) *lang.Language)
- func (s *Server) Adopt()
- func (s *Server) Became() Account
- func (s *Server) Become(account Account) error
- func (s *Server) End() error
- func (s *Server) Health(ctx context.Context) Health
- func (s *Server) Limit()
- func (s *Server) Limits() Limits
- func (s *Server) Serve(ctx context.Context) error
- func (s *Server) Services() *connect.Server
- func (s *Server) Serving() (string, time.Time)
- func (s *Server) Speaking(speak func(profile, named string) *lang.Language)
- type Windows
Constants ¶
const ( HealthPath = "/healthz" LivePath = "/livez" )
Routes of the server that tell whether icebath is well, which ask no password: a container's health check and an orchestrator ask them. The first says whether the server serves and every service it wants up is up and ready, the second whether it serves at all
const ( ProfileHeader = "Icebath-Profile" WindowHeader = "Icebath-Window" YoloHeader = "Icebath-Yolo" )
Request headers carrying the window's profile, its id, and whether its sessions run without asking
const FolderHeader = "Icebath-Folder"
Header of the answers of health naming the settings folder the server serves, as Folder names it
const LanguageHeader = "Icebath-Language"
Header a window names the language it speaks in, on every request of its connection
const StayRoot = "ICEBATH_DOCKER_EXEC_AS_ROOT"
Variable that keeps a process started as root in the container image of icebath root, rather than becoming the account of the image, such as for one command run with docker exec
Variables ¶
This section is empty.
Functions ¶
func Folder ¶
Short name of a settings folder that tells two folders apart without saying their path: the start of the digest of the folder with its links followed
func Own ¶
Whether the request came through this process's own connection rather than over the network
func Profile ¶
Settings of the profile a request names; when it names none, the one its window is on, else the one the process started on. A profile that is not there is not found
func Refuse ¶
A refusal whose message is the error's, which the request's language says where the error holds messages: what a handler returns for an error a person reads
func Routed ¶
Settings of the profile a request of the HTTP API names, which keyed checked the key of; nil for any other request
Types ¶
type Account ¶
type Account struct {
Name string
UID, GID int
// Groups it is a member of besides its own, by id
Groups []int
// Its home folder and login shell, as /etc/passwd of the image gives them
Home, Shell string
// Folder only it may use while it runs, its XDG_RUNTIME_DIR; empty for none
Runtime string
}
Who a process started as root in the container image of icebath becomes before it serves: the account of the image, as its start left it
type Health ¶
type Health struct {
// Address it serves at and since when, empty while it does not serve
At string
Since time.Time
// What of it is not well, none when everything is
Problems []Problem
// What it tells beside, none when nothing
Remarks []Remark
}
How well this icebath is
type Keeper ¶
type Keeper interface {
// What it keeps going that is not well in this icebath now, none when everything is
Unwell(ctx context.Context) []Problem
}
Registrant that keeps something going whose standing the health of icebath counts, such as the services of the runner
type Limits ¶
type Limits struct {
// Files and connections the process may hold open at once, and the most it may raise that to; -1 where the system sets no bound or
// says none, as Windows
Files, FilesMost int64
// Files Open files asks for, zero for none, and those the process started with
FilesAsked, FilesBefore int64
// Why the files could not be raised to what was asked, in a sentence; empty when they were or nothing was asked
FilesWhy string
// The process holds the allocator of glibc, which the C code it runs takes its memory from, and the most arenas that allocator makes as
// it was capped, zero where it was not
Glibc bool
Arenas int
// What gave the cap: the setting, or MALLOC_ARENA_MAX
ArenasBy string
// Why the arenas were not capped as asked, in a sentence; empty when they were or nothing was asked
ArenasWhy string
}
What the system lets this process have of what Open files and Memory arenas ask, as Limit left it
type Notices ¶
type Notices struct {
// contains filtered or unexported fields
}
Notices by profile with a read mark per reader, so each window shows each notice once and a command never takes one from a window
func (*Notices) Masking ¶
Has every notice masked by mask as a reader takes it, as it leaves the process then: by the secrets of its profile, those of every profile for one told to all. mask is called holding no lock
func (*Notices) Read ¶
Unread notices of the profile and of every profile, oldest first, marked read for the reader; an empty reader, such as a command, marks nothing
type Problem ¶
type Problem struct {
// What it is, by the name a person controls it by, and what a person calls it
Name, Title string
// Why it is not well, a sentence
Why string
}
Something of icebath that is not well
type Registrant ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Register ¶
func (r *Registry) Register(registrant Registrant)
type Remark ¶
type Remark struct {
// What it is of, by a name of the code, and what a person calls it
Name, Title string
// What it says, a sentence
Says string
}
Something of icebath its health tells beside whether it is well, such as a stop a person put in force on purpose, which leaves it well
type Remarker ¶
type Remarker interface {
// What it tells now, none when nothing
Remarks(ctx context.Context) []Remark
}
Registrant that tells something of this icebath its health answer says beside whether it is well, such as the emergency stop
type Router ¶
type Router interface {
// Adds what it serves to the mux. Keyed wraps a handler so that it answers only a request that carries the API key of the profile
// the request names, whose settings the handler reads with Routed
Routes(mux *http.ServeMux, keyed func(http.Handler) http.Handler)
}
Registrant that serves plain HTTP beside the services, such as the API other programs speak to the agent in
type Server ¶
type Server struct {
Registry
// The windows that reach this server, and what it has to tell the person on each profile
Windows *Windows
Notices *Notices
// contains filtered or unexported fields
}
func (*Server) Accepting ¶
Has each request of the HTTP API speak the language this gives for its profile and the languages it accepts
func (*Server) Adopt ¶
func (s *Server) Adopt()
Takes up the processes orphaned below this server and reaps them as they end: the first process of its container does from its start, any other makes itself the reaper of its descendants where the system lets a process ask for them, on Linux
func (*Server) Became ¶
Account this process became as it started as root in the container image, the zero one for a process that became no one
func (*Server) Become ¶
Makes this process the account for good, as one started as root in the container image: its groups, its gid and its uid set on every thread, real, effective and saved alike, after which the kernel leaves it no right of root; then the login environment of the account and a working folder it may enter. Verified on every thread before anything else of the process runs, and a process that could take root back ends at once. Nothing for the zero account
func (*Server) End ¶
Ends the processes left of this one once every feature stopped what it owns: the first process of a container every other process of it, a server below the init of a container the processes orphaned below it, each told to end and killed once Processes stop passed. Outside a container what it took up is handed on as it ends, as what icebath started there may be meant to outlive it
func (*Server) Health ¶
How well this icebath is now: whether it serves, and what every registrant that keeps something going says is not well
func (*Server) Limit ¶
func (s *Server) Limit()
Asks the system once for what Open files and Memory arenas set, as the process starts and before the features open their stores: the files the process may hold open raised toward the setting, the most they may be with them where the process may raise that, as root may, and the arenas of the allocator of glibc capped. What came of it is kept for Limits, and what fell short is said in the log
func (*Server) Limits ¶
What the system lets this process have of what the settings ask, as Limit left it; the zero Limits before it ran
func (*Server) Services ¶
The services every feature registered, made the first time they are asked for and the same from then on; asked for only once every feature registered
type Windows ¶
type Windows struct {
// contains filtered or unexported fields
}
Windows connected to this server. A window is live while a stream of it is open; another process's window stays live for twenty seconds after that, and this process's own window stays live while the process runs