Documentation ¶
Index ¶
- Constants
- Variables
- type Certificate
- type CertificateCreate
- type CertificateImport
- type Client
- func (c *Client) Certificate(ctx context.Context, id int) (*Certificate, error)
- func (c *Client) CertificateDelete(ctx context.Context, id int) error
- func (c *Client) CertificateImport(ctx context.Context, name string, cert tls.Certificate) (*Certificate, error)
- func (c *Client) Certificates(ctx context.Context) ([]Certificate, error)
- func (c *Client) CoreGetJob(ctx context.Context, id int) (*Job, error)
- func (c *Client) CoreGetJobs(ctx context.Context, params JobsParams) ([]Job, error)
- func (c *Client) CoreJobWait(ctx context.Context, id int) (*Job, error)
- func (c *Client) SystemGeneral(ctx context.Context) (*SystemGeneral, error)
- func (c *Client) SystemGeneralCheckIn(ctx context.Context) error
- func (c *Client) SystemGeneralUpdate(ctx context.Context, params SystemGeneralUpdateParams) error
- type Date
- type Job
- type JobsParams
- type Option
- type Progress
- type SystemGeneral
- type SystemGeneralUpdateParams
- type Time
- type Timestamp
Constants ¶
View Source
const ( DefaultBaseURL = "http://localhost/api/v2.0/" DefaultUserAgent = "truenas-scale-acme/0.1" )
View Source
const CertificateCreateImported = "CERTIFICATE_CREATE_IMPORTED"
Variables ¶
View Source
var ErrStatus = errors.New("status code error")
ErrStatus respresents a non success status code error.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { ID int `json:"id,omitempty"` Type int `json:"type,omitempty"` Name string `json:"name,omitempty"` Certificate string `json:"certificate,omitempty"` Privatekey string `json:"privatekey,omitempty"` RootPath string `json:"root_path,omitempty"` CertificatePath string `json:"certificate_path,omitempty"` PrivatekeyPath string `json:"privatekey_path,omitempty"` CSRPath string `json:"csr_path,omitempty"` CertType string `json:"cert_type,omitempty"` Revoked bool `json:"revoked,omitempty"` CanBeRevoked bool `json:"can_be_revoked,omitempty"` Internal string `json:"internal,omitempty"` CATypeExisting bool `json:"CA_type_existing,omitempty"` CATypeInternal bool `json:"CA_type_internal,omitempty"` CATypeIntermediate bool `json:"CA_type_intermediate,omitempty"` CertTypeExisting bool `json:"cert_type_existing,omitempty"` CertTypeInternal bool `json:"cert_type_internal,omitempty"` CertTypeCSR bool `json:"cert_type_CSR,omitempty"` Issuer string `json:"issuer,omitempty"` ChainList []string `json:"chain_list,omitempty"` KeyLength int `json:"key_length,omitempty"` KeyType string `json:"key_type,omitempty"` Country string `json:"country,omitempty"` State string `json:"state,omitempty"` City string `json:"city,omitempty"` Organization string `json:"organization,omitempty"` Common string `json:"common,omitempty"` SAN []string `json:"san,omitempty"` Email string `json:"email,omitempty"` DN string `json:"DN,omitempty"` SubjectNameHash int64 `json:"subject_name_hash,omitempty"` DigestAlgorithm string `json:"digest_algorithm,omitempty"` Lifetime int `json:"lifetime,omitempty"` From Time `json:"from,omitempty"` Until Time `json:"until,omitempty"` Serial *big.Int `json:"serial,omitempty"` Chain bool `json:"chain,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Expired bool `json:"expired,omitempty"` Parsed bool `json:"parsed,omitempty"` }
func (*Certificate) TLSCertificate ¶
func (c *Certificate) TLSCertificate() (tls.Certificate, error)
type CertificateCreate ¶
type CertificateCreate string
type CertificateImport ¶
type CertificateImport struct { Name string `json:"name"` CreateType CertificateCreate `json:"create_type"` Certificate string `json:"certificate"` Privatekey string `json:"privatekey"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Certificate ¶
Certificates returns a list of certificates.
func (*Client) CertificateDelete ¶
CertificateDelete deletes a certificate.
func (*Client) CertificateImport ¶
func (c *Client) CertificateImport(ctx context.Context, name string, cert tls.Certificate) (*Certificate, error)
CertificateImport imports a certificate.
func (*Client) Certificates ¶
func (c *Client) Certificates(ctx context.Context) ([]Certificate, error)
Certificates returns a list of certificates.
func (*Client) CoreGetJob ¶
CoreGetJob returns a Job.
func (*Client) CoreGetJobs ¶
CoreGetJobs returns a list of Jobs.
func (*Client) CoreJobWait ¶
CoreJobWait waits for a job to finish.
func (*Client) SystemGeneral ¶
func (c *Client) SystemGeneral(ctx context.Context) (*SystemGeneral, error)
SystemGeneral returns general system config.
func (*Client) SystemGeneralCheckIn ¶
func (*Client) SystemGeneralUpdate ¶
func (c *Client) SystemGeneralUpdate(ctx context.Context, params SystemGeneralUpdateParams) error
SystemGeneralUpdate updates general system config.
type Job ¶
type Job struct { ID int `json:"id,omitempty"` Method string `json:"method,omitempty"` Transient bool `json:"transient,omitempty"` Abortable bool `json:"abortable,omitempty"` LogsPath any `json:"logs_path,omitempty"` LogsExcerpt any `json:"logs_excerpt,omitempty"` Progress Progress `json:"progress,omitempty"` Result any `json:"result,omitempty"` Error string `json:"error,omitempty"` Exception string `json:"exception,omitempty"` State string `json:"state,omitempty"` TimeStarted Date `json:"time_started,omitempty"` TimeFinished Date `json:"time_finished,omitempty"` }
type JobsParams ¶
type Option ¶
type Option func(*Client)
func WithHTTPClient ¶
WithHTTPClient allows to replace the http client.
func WithUserAgent ¶
WithUserAgent allows to change the user agent.
type SystemGeneral ¶
type SystemGeneral struct { ID int `json:"id,omitempty"` Language string `json:"language,omitempty"` KDBMap string `json:"kbdmap,omitempty"` Birthday Date `json:"birthday,omitempty"` Timezone string `json:"timezone,omitempty"` Wizardshown bool `json:"wizardshown,omitempty"` CrashReporting bool `json:"crash_reporting,omitempty"` UsageCollection bool `json:"usage_collection,omitempty"` DSAuth bool `json:"ds_auth,omitempty"` UIAddress []string `json:"ui_address,omitempty"` UIV6Address []string `json:"ui_v6address,omitempty"` UIAllowlist []any `json:"ui_allowlist,omitempty"` UIPort int `json:"ui_port,omitempty"` UIHttpsport int `json:"ui_httpsport,omitempty"` UIHttpsredirect bool `json:"ui_httpsredirect,omitempty"` UIHttpsprotocols []string `json:"ui_httpsprotocols,omitempty"` UIXFrameOptions string `json:"ui_x_frame_options,omitempty"` UIConsolemsg bool `json:"ui_consolemsg,omitempty"` UICertificate Certificate `json:"ui_certificate,omitempty"` CrashReportingIsSet bool `json:"crash_reporting_is_set,omitempty"` UsageCollectionIsSet bool `json:"usage_collection_is_set,omitempty"` }
type Time ¶
func (*Time) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.