Documentation
¶
Index ¶
- Constants
- func CertificateMatchesKey(certPEM, keyPEM []byte) (bool, error)
- func DecodeJSON[T any](body []byte) (T, error)
- func Execute() error
- func NewRootCommand(out, errOut io.Writer) *cobra.Command
- func PrintCA(out io.Writer, ca apiv1.CAInfo, color bool) error
- func PrintCAs(out io.Writer, cas []apiv1.CAInfo, color bool) error
- func PrintCert(out io.Writer, cert apiv1.CertInfoWithCA, color, noca bool) error
- func PrintCertResources(out io.Writer, resources apiv1.CertResources, check bool, color bool) error
- func PrintCerts(out io.Writer, footerStr string, certs []apiv1.CertInfoWithCA, ...) error
- func PrintDNSHandlers(out io.Writer, handlers []apiv1.DNSHandlerInfo, color bool) error
- func PrintDNSRootzones(out io.Writer, rootzones []apiv1.DNSRootzoneInfo, _ bool) error
- func PrintGenericJSON(out io.Writer, body []byte, color bool) error
- func PrintInfo(out io.Writer, info apiv1.ServerInfo, color bool) error
- func SupportsColor(file *os.File) bool
- func ValidatePEM(data []byte) error
- func WriteJSON(out io.Writer, body []byte) error
- func WritePEMDirectory(dir string, resources apiv1.CertResources, check bool) error
- func WritePEMFile(path string, data []byte, check bool) error
- type ChangedFlags
- type Client
- type CommandFactory
- type FlagOptions
- type HTTPError
- type PagedJSON
- type PaginationInfo
- type Paginator
- type Response
- type RuntimeConfig
- type TokenFetcher
Constants ¶
View Source
const ( DefaultConfigPath = "config.yaml" DefaultDaemonOIDCClient = "dns3ld" DefaultTimeout = 60 * time.Second DefaultClaimTimeout = 10 * time.Minute )
View Source
const (
DefaultOIDCClientID = "dns3l-api-pub"
)
View Source
const ImplementedAPIVersion = "1.3.0"
ImplementedAPIVersion is the OpenAPI specification version implemented by dns3lcli.
Variables ¶
This section is empty.
Functions ¶
func CertificateMatchesKey ¶
func DecodeJSON ¶
func PrintCertResources ¶
func PrintCerts ¶
func PrintDNSHandlers ¶
func PrintDNSRootzones ¶
func SupportsColor ¶
func ValidatePEM ¶
func WritePEMDirectory ¶
func WritePEMDirectory(dir string, resources apiv1.CertResources, check bool) error
Types ¶
type ChangedFlags ¶
type Client ¶
type Client struct {
Config *RuntimeConfig
HTTPClient *http.Client
TokenFetcher *TokenFetcher
}
func NewClient ¶
func NewClient(cfg *RuntimeConfig) *Client
type CommandFactory ¶
type FlagOptions ¶
type FlagOptions struct {
ConfigPath string
Server string
ADUser string
ADPassword string
OIDCClientID string
OIDCClientSecret string
OIDCDaemonClientID string
Token string
APIKey string
NoAuth bool
JSON bool
Debug bool
Trace bool
Timeout time.Duration
TimeoutClaim time.Duration
HiddenPaging uint64
}
type PaginationInfo ¶
type PaginationInfo struct {
// contains filtered or unexported fields
}
func PaginationInfoFromHeaders ¶
func PaginationInfoFromHeaders(header http.Header) *PaginationInfo
func (*PaginationInfo) String ¶
func (p *PaginationInfo) String() string
type Paginator ¶
type Paginator struct {
// contains filtered or unexported fields
}
func NewPaginator ¶
type RuntimeConfig ¶
type RuntimeConfig struct {
Server string
ADUser string
ADPassword string
OIDCClientID string
OIDCClientSecret string
OIDCDaemonClientID string
Token string
APIKey string
NoAuth bool
JSON bool
Debug bool
Trace bool
Timeout time.Duration
TimeoutClaim time.Duration
HiddenPaging uint64
APIBaseURL string
AuthURL string
}
func ResolveConfig ¶
func ResolveConfig(opts FlagOptions, changed ChangedFlags, requireAuth bool) (*RuntimeConfig, error)
type TokenFetcher ¶
func (*TokenFetcher) Fetch ¶
func (f *TokenFetcher) Fetch(ctx context.Context, cfg *RuntimeConfig) (string, error)
Click to show internal directories.
Click to hide internal directories.