adminapi

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package adminapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Package adminapi implements the administration API used by the web UI. Types and routing are generated from api/openapi.yaml (api.gen.go).

Index

Constants

View Source
const (
	// BasePath is where the API is mounted.
	BasePath = "/api/v1"
)

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type APIToken

type APIToken struct {
	// Admin The admin the token acts as.
	Admin       string     `json:"admin"`
	CreatedAt   time.Time  `json:"createdAt"`
	Description string     `json:"description"`
	ExpiresAt   *time.Time `json:"expiresAt,omitempty"`
	Id          string     `json:"id"`
	LastUsed    *time.Time `json:"lastUsed,omitempty"`
}

APIToken defines model for APIToken.

type APITokenCreate

type APITokenCreate struct {
	Description *string `json:"description,omitempty"`

	// TtlSeconds Lifetime in seconds; 0 never expires.
	TtlSeconds int `json:"ttlSeconds"`
}

APITokenCreate defines model for APITokenCreate.

type APITokenCreated

type APITokenCreated struct {
	Secret string   `json:"secret"`
	Token  APIToken `json:"token"`
}

APITokenCreated defines model for APITokenCreated.

type AuditEntry

type AuditEntry struct {
	Action string    `json:"action"`
	Actor  string    `json:"actor"`
	Detail string    `json:"detail"`
	Id     int64     `json:"id"`
	Target string    `json:"target"`
	Time   time.Time `json:"time"`
}

AuditEntry defines model for AuditEntry.

type AuthKey

type AuthKey struct {
	CreatedAt   time.Time  `json:"createdAt"`
	Description string     `json:"description"`
	ExpiresAt   *time.Time `json:"expiresAt,omitempty"`
	Id          string     `json:"id"`
	Reusable    bool       `json:"reusable"`
	Revoked     bool       `json:"revoked"`

	// Tags Given to nodes the key enrolls.
	Tags      []string `json:"tags"`
	UsedCount int      `json:"usedCount"`

	// Valid Whether it can still enroll a node.
	Valid bool `json:"valid"`
}

AuthKey defines model for AuthKey.

type AuthKeyCreate

type AuthKeyCreate struct {
	Description *string   `json:"description,omitempty"`
	Reusable    bool      `json:"reusable"`
	Tags        *[]string `json:"tags,omitempty"`

	// TtlSeconds Lifetime in seconds; 0 means the key never expires.
	TtlSeconds int `json:"ttlSeconds"`
}

AuthKeyCreate defines model for AuthKeyCreate.

type AuthKeyCreated

type AuthKeyCreated struct {
	Key    AuthKey `json:"key"`
	Secret string  `json:"secret"`
}

AuthKeyCreated defines model for AuthKeyCreated.

type AuthMethods

type AuthMethods struct {
	Oidc bool `json:"oidc"`

	// OidcName Label for the single sign-on button.
	OidcName *string `json:"oidcName,omitempty"`
	Password bool    `json:"password"`
}

AuthMethods defines model for AuthMethods.

type ChangePasswordJSONRequestBody

type ChangePasswordJSONRequestBody = PasswordChange

ChangePasswordJSONRequestBody defines body for ChangePassword for application/json ContentType.

type CheckPolicyJSONRequestBody

type CheckPolicyJSONRequestBody = PolicyCheck

CheckPolicyJSONRequestBody defines body for CheckPolicy for application/json ContentType.

type CompleteSetupJSONRequestBody

type CompleteSetupJSONRequestBody = SetupRequest

CompleteSetupJSONRequestBody defines body for CompleteSetup for application/json ContentType.

type CreateAPITokenJSONRequestBody

type CreateAPITokenJSONRequestBody = APITokenCreate

CreateAPITokenJSONRequestBody defines body for CreateAPIToken for application/json ContentType.

type CreateAuthKeyJSONRequestBody

type CreateAuthKeyJSONRequestBody = AuthKeyCreate

CreateAuthKeyJSONRequestBody defines body for CreateAuthKey for application/json ContentType.

type DNSConfig

type DNSConfig struct {
	// Domain Example: mesh.internal
	Domain string `json:"domain"`

	// MagicDNS Nodes answer <node>.<domain> at 100.100.100.100.
	MagicDNS bool       `json:"magicDNS"`
	Split    []SplitDNS `json:"split"`
}

DNSConfig defines model for DNSConfig.

type Error

type Error struct {
	Error string `json:"error"`
}

Error defines model for Error.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type ListAuditParams

type ListAuditParams struct {
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Before Only entries with a smaller id (paging).
	Before *int64 `form:"before,omitempty" json:"before,omitempty"`
}

ListAuditParams defines parameters for ListAudit.

type LoginJSONRequestBody

type LoginJSONRequestBody = LoginRequest

LoginJSONRequestBody defines body for Login for application/json ContentType.

type LoginRequest

type LoginRequest struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

LoginRequest defines model for LoginRequest.

type Me

type Me struct {
	// HasPassword False for admins who only sign in through SSO.
	HasPassword bool   `json:"hasPassword"`
	Username    string `json:"username"`
}

Me defines model for Me.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Node

type Node struct {
	Addresses []string `json:"addresses"`

	// AdvertisedRoutes Subnets the node offers to forward to; 0.0.0.0/0 offers an exit node.
	AdvertisedRoutes []string `json:"advertisedRoutes"`

	// ApprovedRoutes Routes an admin or the policy's autoApprovers allowed.
	ApprovedRoutes []string  `json:"approvedRoutes"`
	CreatedAt      time.Time `json:"createdAt"`
	Endpoints      []string  `json:"endpoints"`

	// ExpiresAt When the node must re-authenticate; null means never.
	ExpiresAt         *time.Time `json:"expiresAt,omitempty"`
	Hostname          string     `json:"hostname"`
	Id                string     `json:"id"`
	KeyExpiryDisabled bool       `json:"keyExpiryDisabled"`
	LastSeen          time.Time  `json:"lastSeen"`
	Name              string     `json:"name"`
	Online            bool       `json:"online"`
	Os                string     `json:"os"`

	// PublicKey WireGuard public key (base64).
	PublicKey string `json:"publicKey"`

	// Routes Routes in effect (advertised and approved).
	Routes []string `json:"routes"`
	Tags   []string `json:"tags"`
}

Node defines model for Node.

type NodeUpdate

type NodeUpdate struct {
	// ApprovedRoutes Replaces the routes the node may use (CIDR).
	ApprovedRoutes *[]string `json:"approvedRoutes,omitempty"`

	// ExpireNow Expire the node's key immediately; it must re-authenticate.
	ExpireNow *bool `json:"expireNow,omitempty"`

	// KeyExpiryDisabled Exempt the node from key expiry, or subject it again (expiry restarts now).
	KeyExpiryDisabled *bool   `json:"keyExpiryDisabled,omitempty"`
	Name              *string `json:"name,omitempty"`

	// Tags Replaces the node's tags, e.g. ["tag:server"].
	Tags *[]string `json:"tags,omitempty"`
}

NodeUpdate Fields to change; omitted fields stay as they are.

type OIDCConfig

type OIDCConfig struct {
	Issuer       string
	ClientID     string
	ClientSecret string
	// RedirectURL is registered with the provider; empty derives it from
	// the public URL setting or the request.
	RedirectURL string
	// Allowed lists who may sign in: exact email addresses, or "@domain"
	// for a whole domain. Empty allows nobody.
	Allowed []string
	// Name labels the sign-in button, e.g. "Google".
	Name string
}

OIDCConfig enables single sign-on for admins through an OpenID Connect provider (Google, Microsoft Entra ID, Okta, Keycloak, Authentik, ...).

type OidcCallbackParams

type OidcCallbackParams struct {
	Code  *string `form:"code,omitempty" json:"code,omitempty"`
	State *string `form:"state,omitempty" json:"state,omitempty"`
	Error *string `form:"error,omitempty" json:"error,omitempty"`
}

OidcCallbackParams defines parameters for OidcCallback.

type Options

type Options struct {
	// SetupCode is the first-run setup code; random if empty.
	SetupCode string
	// OIDC enables single sign-on; nil disables it.
	OIDC *OIDCConfig
}

Options configures the API server.

type PasswordChange

type PasswordChange struct {
	CurrentPassword string `json:"currentPassword"`
	NewPassword     string `json:"newPassword"`
}

PasswordChange defines model for PasswordChange.

type Policy

type Policy struct {
	// Policy HuJSON policy document.
	Policy string `json:"policy"`
}

Policy defines model for Policy.

type PolicyCheck

type PolicyCheck struct {
	// Dst Node name or IPv4 address (may be inside a route).
	Dst string `json:"dst"`

	// Policy Draft policy to check instead of the saved one.
	Policy *string           `json:"policy,omitempty"`
	Port   int               `json:"port"`
	Proto  *PolicyCheckProto `json:"proto,omitempty"`

	// Src Node name or IPv4 address.
	Src string `json:"src"`
}

PolicyCheck defines model for PolicyCheck.

type PolicyCheckProto

type PolicyCheckProto string

PolicyCheckProto defines model for PolicyCheck.Proto.

const (
	Icmp PolicyCheckProto = "icmp"
	Tcp  PolicyCheckProto = "tcp"
	Udp  PolicyCheckProto = "udp"
)

Defines values for PolicyCheckProto.

func (PolicyCheckProto) Valid

func (e PolicyCheckProto) Valid() bool

Valid indicates whether the value is a known member of the PolicyCheckProto enum.

type PolicyCheckResult

type PolicyCheckResult struct {
	Allowed bool   `json:"allowed"`
	DstAddr string `json:"dstAddr"`
	Reason  string `json:"reason"`

	// Rule Index of the matching ACL.
	Rule    *int   `json:"rule,omitempty"`
	SrcAddr string `json:"srcAddr"`
}

PolicyCheckResult defines model for PolicyCheckResult.

type PolicyError

type PolicyError struct {
	Details []string `json:"details"`
	Error   string   `json:"error"`
}

PolicyError defines model for PolicyError.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	http.Handler
}

ServeMux is an abstraction of http.ServeMux.

type Server

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

Server implements ServerInterface.

func New

func New(ctx context.Context, st *store.Store, ctl *control.Service, opts Options, log *slog.Logger) (*Server, error)

New returns the API server. If no admin exists yet it generates a one-time setup code (or uses setupCode if non-empty) and logs it: whoever completes setup must be able to read the coordinator's log.

func (*Server) ChangePassword

func (s *Server) ChangePassword(w http.ResponseWriter, r *http.Request)

func (*Server) CheckPolicy

func (s *Server) CheckPolicy(w http.ResponseWriter, r *http.Request)

func (*Server) CompleteSetup

func (s *Server) CompleteSetup(w http.ResponseWriter, r *http.Request)

func (*Server) CreateAPIToken

func (s *Server) CreateAPIToken(w http.ResponseWriter, r *http.Request)

func (*Server) CreateAuthKey

func (s *Server) CreateAuthKey(w http.ResponseWriter, r *http.Request)

func (*Server) DeleteAPIToken

func (s *Server) DeleteAPIToken(w http.ResponseWriter, r *http.Request, id string)

func (*Server) DeleteNode

func (s *Server) DeleteNode(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetAuthMethods

func (s *Server) GetAuthMethods(w http.ResponseWriter, _ *http.Request)

func (*Server) GetDNS

func (s *Server) GetDNS(w http.ResponseWriter, r *http.Request)

func (*Server) GetMe

func (s *Server) GetMe(w http.ResponseWriter, r *http.Request)

func (*Server) GetNode

func (s *Server) GetNode(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetPolicy

func (s *Server) GetPolicy(w http.ResponseWriter, r *http.Request)

func (*Server) GetSettings

func (s *Server) GetSettings(w http.ResponseWriter, r *http.Request)

func (*Server) GetSetup

func (s *Server) GetSetup(w http.ResponseWriter, _ *http.Request)

func (*Server) GetStats

func (s *Server) GetStats(w http.ResponseWriter, r *http.Request)

func (*Server) GetTopology

func (s *Server) GetTopology(w http.ResponseWriter, _ *http.Request)

func (*Server) GetVersion

func (s *Server) GetVersion(w http.ResponseWriter, _ *http.Request)

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the API handler, to be mounted at BasePath + "/".

func (*Server) ListAPITokens

func (s *Server) ListAPITokens(w http.ResponseWriter, r *http.Request)

func (*Server) ListAudit

func (s *Server) ListAudit(w http.ResponseWriter, r *http.Request, params ListAuditParams)

func (*Server) ListAuthKeys

func (s *Server) ListAuthKeys(w http.ResponseWriter, r *http.Request)

func (*Server) ListNodes

func (s *Server) ListNodes(w http.ResponseWriter, r *http.Request)

func (*Server) Login

func (s *Server) Login(w http.ResponseWriter, r *http.Request)

func (*Server) Logout

func (s *Server) Logout(w http.ResponseWriter, r *http.Request)

func (*Server) OidcCallback

func (s *Server) OidcCallback(w http.ResponseWriter, r *http.Request, params OidcCallbackParams)

func (*Server) OidcLogin

func (s *Server) OidcLogin(w http.ResponseWriter, r *http.Request)

func (*Server) RevokeAuthKey

func (s *Server) RevokeAuthKey(w http.ResponseWriter, r *http.Request, id string)

func (*Server) SetDNS

func (s *Server) SetDNS(w http.ResponseWriter, r *http.Request)

func (*Server) SetPolicy

func (s *Server) SetPolicy(w http.ResponseWriter, r *http.Request)

func (*Server) StreamEvents

func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request)

StreamEvents sends a `change` event whenever the mesh changes.

func (*Server) UpdateNode

func (s *Server) UpdateNode(w http.ResponseWriter, r *http.Request, id string)

func (*Server) UpdateSettings

func (s *Server) UpdateSettings(w http.ResponseWriter, r *http.Request)

type ServerInterface

type ServerInterface interface {

	// (GET /audit)
	ListAudit(w http.ResponseWriter, r *http.Request, params ListAuditParams)

	// (POST /auth/login)
	Login(w http.ResponseWriter, r *http.Request)

	// (POST /auth/logout)
	Logout(w http.ResponseWriter, r *http.Request)

	// (GET /auth/me)
	GetMe(w http.ResponseWriter, r *http.Request)

	// (GET /auth/methods)
	GetAuthMethods(w http.ResponseWriter, r *http.Request)

	// (GET /auth/oidc/callback)
	OidcCallback(w http.ResponseWriter, r *http.Request, params OidcCallbackParams)

	// (GET /auth/oidc/login)
	OidcLogin(w http.ResponseWriter, r *http.Request)

	// (POST /auth/password)
	ChangePassword(w http.ResponseWriter, r *http.Request)

	// (GET /authkeys)
	ListAuthKeys(w http.ResponseWriter, r *http.Request)

	// (POST /authkeys)
	CreateAuthKey(w http.ResponseWriter, r *http.Request)

	// (DELETE /authkeys/{id})
	RevokeAuthKey(w http.ResponseWriter, r *http.Request, id string)

	// (GET /dns)
	GetDNS(w http.ResponseWriter, r *http.Request)

	// (PUT /dns)
	SetDNS(w http.ResponseWriter, r *http.Request)

	// (GET /events)
	StreamEvents(w http.ResponseWriter, r *http.Request)

	// (GET /nodes)
	ListNodes(w http.ResponseWriter, r *http.Request)

	// (DELETE /nodes/{id})
	DeleteNode(w http.ResponseWriter, r *http.Request, id string)

	// (GET /nodes/{id})
	GetNode(w http.ResponseWriter, r *http.Request, id string)

	// (PATCH /nodes/{id})
	UpdateNode(w http.ResponseWriter, r *http.Request, id string)

	// (GET /policy)
	GetPolicy(w http.ResponseWriter, r *http.Request)

	// (PUT /policy)
	SetPolicy(w http.ResponseWriter, r *http.Request)

	// (POST /policy/check)
	CheckPolicy(w http.ResponseWriter, r *http.Request)

	// (GET /settings)
	GetSettings(w http.ResponseWriter, r *http.Request)

	// (PATCH /settings)
	UpdateSettings(w http.ResponseWriter, r *http.Request)

	// (GET /setup)
	GetSetup(w http.ResponseWriter, r *http.Request)

	// (POST /setup)
	CompleteSetup(w http.ResponseWriter, r *http.Request)

	// (GET /stats)
	GetStats(w http.ResponseWriter, r *http.Request)

	// (GET /tokens)
	ListAPITokens(w http.ResponseWriter, r *http.Request)

	// (POST /tokens)
	CreateAPIToken(w http.ResponseWriter, r *http.Request)

	// (DELETE /tokens/{id})
	DeleteAPIToken(w http.ResponseWriter, r *http.Request, id string)

	// (GET /topology)
	GetTopology(w http.ResponseWriter, r *http.Request)

	// (GET /version)
	GetVersion(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ChangePassword

func (siw *ServerInterfaceWrapper) ChangePassword(w http.ResponseWriter, r *http.Request)

ChangePassword operation middleware

func (*ServerInterfaceWrapper) CheckPolicy

func (siw *ServerInterfaceWrapper) CheckPolicy(w http.ResponseWriter, r *http.Request)

CheckPolicy operation middleware

func (*ServerInterfaceWrapper) CompleteSetup

func (siw *ServerInterfaceWrapper) CompleteSetup(w http.ResponseWriter, r *http.Request)

CompleteSetup operation middleware

func (*ServerInterfaceWrapper) CreateAPIToken

func (siw *ServerInterfaceWrapper) CreateAPIToken(w http.ResponseWriter, r *http.Request)

CreateAPIToken operation middleware

func (*ServerInterfaceWrapper) CreateAuthKey

func (siw *ServerInterfaceWrapper) CreateAuthKey(w http.ResponseWriter, r *http.Request)

CreateAuthKey operation middleware

func (*ServerInterfaceWrapper) DeleteAPIToken

func (siw *ServerInterfaceWrapper) DeleteAPIToken(w http.ResponseWriter, r *http.Request)

DeleteAPIToken operation middleware

func (*ServerInterfaceWrapper) DeleteNode

func (siw *ServerInterfaceWrapper) DeleteNode(w http.ResponseWriter, r *http.Request)

DeleteNode operation middleware

func (*ServerInterfaceWrapper) GetAuthMethods

func (siw *ServerInterfaceWrapper) GetAuthMethods(w http.ResponseWriter, r *http.Request)

GetAuthMethods operation middleware

func (*ServerInterfaceWrapper) GetDNS

GetDNS operation middleware

func (*ServerInterfaceWrapper) GetMe

GetMe operation middleware

func (*ServerInterfaceWrapper) GetNode

GetNode operation middleware

func (*ServerInterfaceWrapper) GetPolicy

func (siw *ServerInterfaceWrapper) GetPolicy(w http.ResponseWriter, r *http.Request)

GetPolicy operation middleware

func (*ServerInterfaceWrapper) GetSettings

func (siw *ServerInterfaceWrapper) GetSettings(w http.ResponseWriter, r *http.Request)

GetSettings operation middleware

func (*ServerInterfaceWrapper) GetSetup

func (siw *ServerInterfaceWrapper) GetSetup(w http.ResponseWriter, r *http.Request)

GetSetup operation middleware

func (*ServerInterfaceWrapper) GetStats

func (siw *ServerInterfaceWrapper) GetStats(w http.ResponseWriter, r *http.Request)

GetStats operation middleware

func (*ServerInterfaceWrapper) GetTopology

func (siw *ServerInterfaceWrapper) GetTopology(w http.ResponseWriter, r *http.Request)

GetTopology operation middleware

func (*ServerInterfaceWrapper) GetVersion

func (siw *ServerInterfaceWrapper) GetVersion(w http.ResponseWriter, r *http.Request)

GetVersion operation middleware

func (*ServerInterfaceWrapper) ListAPITokens

func (siw *ServerInterfaceWrapper) ListAPITokens(w http.ResponseWriter, r *http.Request)

ListAPITokens operation middleware

func (*ServerInterfaceWrapper) ListAudit

func (siw *ServerInterfaceWrapper) ListAudit(w http.ResponseWriter, r *http.Request)

ListAudit operation middleware

func (*ServerInterfaceWrapper) ListAuthKeys

func (siw *ServerInterfaceWrapper) ListAuthKeys(w http.ResponseWriter, r *http.Request)

ListAuthKeys operation middleware

func (*ServerInterfaceWrapper) ListNodes

func (siw *ServerInterfaceWrapper) ListNodes(w http.ResponseWriter, r *http.Request)

ListNodes operation middleware

func (*ServerInterfaceWrapper) Login

Login operation middleware

func (*ServerInterfaceWrapper) Logout

Logout operation middleware

func (*ServerInterfaceWrapper) OidcCallback

func (siw *ServerInterfaceWrapper) OidcCallback(w http.ResponseWriter, r *http.Request)

OidcCallback operation middleware

func (*ServerInterfaceWrapper) OidcLogin

func (siw *ServerInterfaceWrapper) OidcLogin(w http.ResponseWriter, r *http.Request)

OidcLogin operation middleware

func (*ServerInterfaceWrapper) RevokeAuthKey

func (siw *ServerInterfaceWrapper) RevokeAuthKey(w http.ResponseWriter, r *http.Request)

RevokeAuthKey operation middleware

func (*ServerInterfaceWrapper) SetDNS

SetDNS operation middleware

func (*ServerInterfaceWrapper) SetPolicy

func (siw *ServerInterfaceWrapper) SetPolicy(w http.ResponseWriter, r *http.Request)

SetPolicy operation middleware

func (*ServerInterfaceWrapper) StreamEvents

func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request)

StreamEvents operation middleware

func (*ServerInterfaceWrapper) UpdateNode

func (siw *ServerInterfaceWrapper) UpdateNode(w http.ResponseWriter, r *http.Request)

UpdateNode operation middleware

func (*ServerInterfaceWrapper) UpdateSettings

func (siw *ServerInterfaceWrapper) UpdateSettings(w http.ResponseWriter, r *http.Request)

UpdateSettings operation middleware

type SetDNSJSONRequestBody

type SetDNSJSONRequestBody = DNSConfig

SetDNSJSONRequestBody defines body for SetDNS for application/json ContentType.

type SetPolicyJSONRequestBody

type SetPolicyJSONRequestBody = Policy

SetPolicyJSONRequestBody defines body for SetPolicy for application/json ContentType.

type Settings

type Settings struct {
	// KeyExpiryDays Days a node key lasts before it must re-authenticate; 0 is forever.
	KeyExpiryDays int    `json:"keyExpiryDays"`
	NetworkPrefix string `json:"networkPrefix"`
	PublicURL     string `json:"publicURL"`
	RelayEnabled  bool   `json:"relayEnabled"`
	StunPort      int    `json:"stunPort"`
	Version       string `json:"version"`
}

Settings defines model for Settings.

type SettingsUpdate

type SettingsUpdate struct {
	KeyExpiryDays *int    `json:"keyExpiryDays,omitempty"`
	PublicURL     *string `json:"publicURL,omitempty"`
}

SettingsUpdate defines model for SettingsUpdate.

type SetupRequest

type SetupRequest struct {
	Password string `json:"password"`

	// PublicURL URL nodes use to reach the coordinator, e.g. https://mesh.example.com
	PublicURL *string `json:"publicURL,omitempty"`
	SetupCode string  `json:"setupCode"`
	Username  string  `json:"username"`
}

SetupRequest defines model for SetupRequest.

type SetupStatus

type SetupStatus struct {
	NeedsSetup bool `json:"needsSetup"`
}

SetupStatus defines model for SetupStatus.

type SplitDNS

type SplitDNS struct {
	// Domain Example: corp.example.com
	Domain string `json:"domain"`

	// Resolvers Example: ["10.0.0.53"]
	Resolvers []string `json:"resolvers"`
}

SplitDNS defines model for SplitDNS.

type Stats

type Stats struct {
	Nodes  int `json:"nodes"`
	Online int `json:"online"`
}

Stats defines model for Stats.

type StdHTTPServerOptions

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Topology

type Topology struct {
	Links []TopologyLink `json:"links"`
}

Topology defines model for Topology.

type TopologyLink struct {
	// From Reporting node ID.
	From      string           `json:"from"`
	LatencyMs *float64         `json:"latencyMs,omitempty"`
	Path      TopologyLinkPath `json:"path"`

	// To Peer node ID.
	To string `json:"to"`
}

TopologyLink defines model for TopologyLink.

type TopologyLinkPath

type TopologyLinkPath string

TopologyLinkPath defines model for TopologyLink.Path.

const (
	Direct TopologyLinkPath = "direct"
	Relay  TopologyLinkPath = "relay"
)

Defines values for TopologyLinkPath.

func (TopologyLinkPath) Valid

func (e TopologyLinkPath) Valid() bool

Valid indicates whether the value is a known member of the TopologyLinkPath enum.

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateNodeJSONRequestBody

type UpdateNodeJSONRequestBody = NodeUpdate

UpdateNodeJSONRequestBody defines body for UpdateNode for application/json ContentType.

type UpdateSettingsJSONRequestBody

type UpdateSettingsJSONRequestBody = SettingsUpdate

UpdateSettingsJSONRequestBody defines body for UpdateSettings for application/json ContentType.

type Version

type Version struct {
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"goVersion"`
	Platform  string `json:"platform"`
	Version   string `json:"version"`
}

Version defines model for Version.

Jump to

Keyboard shortcuts

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