teclient

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIDetail added in v0.2.0

type APIDetail struct {
	Detail string `json:"detail"`
}

type APIEnvironment added in v0.1.3

type APIEnvironment int

Environment

const (
	ProdEnv    APIEnvironment = 0
	StagingEnv APIEnvironment = 1
)

type APIMessage added in v0.2.0

type APIMessage struct {
	Message string `json:"message"`
}

API

type BackendAPIModel

type BackendAPIModel struct {
	ID           int    `json:"id"`
	Company      int    `json:"company"`
	Name         string `json:"name"`
	Origin       string `json:"origin"`
	Ssl          bool   `json:"ssl"`
	Port         int    `json:"port"`
	HCHost       string `json:"host"`
	HCPath       string `json:"health_check"`
	HCStatusCode int    `json:"status_code"`
}

Backends

type CRDNSCNAMEVerification added in v0.5.0

type CRDNSCNAMEVerification struct {
	CNAME string `json:"cname"`
}

type CRDNSCredential added in v0.5.0

type CRDNSCredential struct {
	ID    int          `json:"id"`
	Alias string       `json:"alias"`
	Creds []CRDNSCreds `json:"creds"`
}

type CRDNSCreds added in v0.5.0

type CRDNSCreds struct {
	Provider string `json:"provider"`
	KeyName  string `json:"dns_key_name"`
	KeyValue string `json:"dns_key_value"`
}

type CRDNSKeys added in v0.5.0

type CRDNSKeys struct {
	KeyNameID int    `json:"key_name_id"`
	KeyName   string `json:"key_name"`
}

DNS Certificate Requests

type CRDNSProvider added in v0.5.0

type CRDNSProvider struct {
	ID       int         `json:"id"`
	HookName string      `json:"hook_name"`
	Provider string      `json:"provider"`
	Keys     []CRDNSKeys `json:"keys"`
}

type CertReqDNS added in v0.5.0

type CertReqDNS struct {
	ID         int    `json:"id"`
	Credential int    `json:"credential"`
	Domains    string `json:"domains"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
	// as pointers since they can be null
	CertificateID *int    `json:"certificate"`
	Log           *string `json:"log"`
}

type CertReqHTTP added in v0.5.0

type CertReqHTTP struct {
	ID         int    `json:"id"`
	CommonName string `json:"cn"`
	SAN        string `json:"san"`
	Standalone bool   `json:"standalone"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"last_modified_at"`
	// as pointers since they can be null
	CertificateID *int    `json:"certificate"`
	Log           *string `json:"error_text"`
}

HTTP Certificate Requests

type Client

type Client struct {
	HTTPClient *http.Client
	Token      TokenStruct

	HostURL      string
	CompanyId    int
	ClientId     string
	ClientSecret string
	VerifySSL    bool
	UserAgent    string
}

func NewClient

func NewClient(host *string, companyid *int, clientid *string, clientsecret *string, insecure *bool, auth *bool, useragent *string) (*Client, error)

func (*Client) CreateBackend

func (c *Client) CreateBackend(backend NewBackendAPIModel, environment APIEnvironment) (*BackendAPIModel, error)

func (*Client) CreateCustomCertificate added in v0.2.0

func (c *Client) CreateCustomCertificate(cert SSLCustomCertificate) (*SSLCertificate, error)

func (*Client) CreateDNSCertReq added in v0.5.0

func (c *Client) CreateDNSCertReq(certreq interface{}) (*CertReqDNS, error)

func (*Client) CreateDNSCredential added in v0.5.0

func (c *Client) CreateDNSCredential(dns_credential NewCRDNSCredential) (*CRDNSCredential, error)

func (*Client) CreateHTTPCertReq added in v0.5.0

func (c *Client) CreateHTTPCertReq(certreq interface{}) (*CertReqHTTP, error)

func (*Client) CreateSite

func (c *Client) CreateSite(site SiteNewAPIModel) (*SiteAPIModel, bool, error)

func (*Client) CreateVclconf added in v0.1.2

func (c *Client) CreateVclconf(vclconf NewVCLConfAPIModel, environment APIEnvironment) (*VCLConfAPIModel, error)

func (*Client) DeleteBackend

func (c *Client) DeleteBackend(backendID int, environment APIEnvironment) error

func (*Client) DeleteCRCredential added in v0.5.0

func (c *Client) DeleteCRCredential(id int) error

func (*Client) DeleteCustomCertificate added in v0.2.0

func (c *Client) DeleteCustomCertificate(certID int) error

func (*Client) DeleteSite

func (c *Client) DeleteSite(siteID int) error

func (*Client) DeteleDNSCertReq added in v0.5.0

func (c *Client) DeteleDNSCertReq(id int) error

func (*Client) GetActiveVCLConf added in v0.1.1

func (c *Client) GetActiveVCLConf(environment APIEnvironment) (*VCLConfAPIModel, error)

func (*Client) GetBackend

func (c *Client) GetBackend(backendID int, environment APIEnvironment) (*BackendAPIModel, error)

func (*Client) GetBackendByName added in v0.3.0

func (c *Client) GetBackendByName(name string, environment APIEnvironment) (*BackendAPIModel, error)

func (*Client) GetBackends

func (c *Client) GetBackends(environment APIEnvironment) ([]BackendAPIModel, error)

func (*Client) GetCRDNSCredential added in v0.5.0

func (c *Client) GetCRDNSCredential(id int) (CRDNSCredential, error)

func (*Client) GetCRDNSProviders added in v0.5.0

func (c *Client) GetCRDNSProviders() ([]CRDNSProvider, error)

func (*Client) GetCertReqDNS added in v0.5.0

func (c *Client) GetCertReqDNS(id int) (CertReqDNS, error)

func (*Client) GetCertReqHTTP added in v0.5.0

func (c *Client) GetCertReqHTTP(id int) (CertReqHTTP, error)

func (*Client) GetCertificate added in v0.2.0

func (c *Client) GetCertificate(certID int) (*SSLCertificate, error)

func (*Client) GetCertificates added in v0.1.5

func (c *Client) GetCertificates() ([]SSLCertificate, error)

func (*Client) GetDNSCNAMEVerification added in v0.5.0

func (c *Client) GetDNSCNAMEVerification() (string, error)

func (*Client) GetIPRanges added in v0.2.6

func (c *Client) GetIPRanges() ([]string, error)

func (*Client) GetIfExists

func (c *Client) GetIfExists(body []byte, site_domain string) *SiteAPIModel

func (*Client) GetSite

func (c *Client) GetSite(siteID int) (*SiteAPIModel, error)

func (*Client) GetSiteVerifyString

func (c *Client) GetSiteVerifyString(site_domain string) string

func (*Client) GetSites

func (c *Client) GetSites() ([]SiteAPIModel, error)

func (*Client) GetVclConfs added in v0.1.1

func (c *Client) GetVclConfs(offset int, environment APIEnvironment) ([]VCLConfAPIModel, error)

func (*Client) MustGetAPIEnvironmentPath added in v0.3.0

func (c *Client) MustGetAPIEnvironmentPath(environment APIEnvironment) string

func (*Client) UpdateBackend

func (c *Client) UpdateBackend(backend BackendAPIModel, environment APIEnvironment) (*BackendAPIModel, error)

func (*Client) UpdateCustomCertificate added in v0.2.0

func (c *Client) UpdateCustomCertificate(cert SSLCustomCertificate) (*SSLCertificate, error)

func (*Client) UpdateDNSCertReq added in v0.5.0

func (c *Client) UpdateDNSCertReq(certreq_id int, credential_id int) error

func (*Client) UpdateDNSCredential added in v0.5.0

func (c *Client) UpdateDNSCredential(dns_credential NewCRDNSCredential, id int) (*CRDNSCredential, error)

type NewBackendAPIModel

type NewBackendAPIModel struct {
	Name         string `json:"name"`
	Origin       string `json:"origin"`
	Ssl          bool   `json:"ssl"`
	Port         int    `json:"port"`
	HCHost       string `json:"host"`
	HCPath       string `json:"health_check"`
	HCStatusCode int    `json:"status_code"`
}

type NewCRDNSCredential added in v0.5.0

type NewCRDNSCredential struct {
	Alias string          `json:"alias"`
	Creds []NewCRDNSCreds `json:"creds"`
}

type NewCRDNSCreds added in v0.5.0

type NewCRDNSCreds struct {
	KeyName  string `json:"hook_key_name"`
	KeyValue string `json:"hook_key_value"`
}

type NewVCLConfAPIModel added in v0.1.2

type NewVCLConfAPIModel struct {
	VCLCode string `json:"config_body"`
}

type SSLCertificate added in v0.1.5

type SSLCertificate struct {
	ID            int      `json:"id"`
	Company       int      `json:"company"`
	CommonName    string   `json:"name"`
	Domains       []string `json:"domains"`
	Expiration    string   `json:"expiration"`
	Autogenerated bool     `json:"autogenerated"`
	Standalone    bool     `json:"standalone"`
	DNSChallenge  bool     `json:"dns_challenge"`
	PublicKey     string   `json:"cert"`
	PrivateKey    string   `json:"key"`
}

Certificates

type SSLCustomCertificate added in v0.2.0

type SSLCustomCertificate struct {
	ID            int    `json:"id"`
	Autogenerated bool   `json:"autogenerated"`
	DNSChallenge  bool   `json:"dns_challenge"`
	PublicKey     string `json:"cert"`
	PrivateKey    string `json:"key"`
}

type SiteAPIModel

type SiteAPIModel struct {
	ID      int    `json:"id"`
	Company int    `json:"company"`
	Url     string `json:"url"`
	Active  bool   `json:"active"`
	Ssl     bool   `json:"ssl"`
}

Sites

type SiteNewAPIModel

type SiteNewAPIModel struct {
	Url string `json:"url"`
}

type SiteVerifyStringAPIModelRequest

type SiteVerifyStringAPIModelRequest struct {
	Domain string `json:"domain"`
}

type SiteVerifyStringAPIModelResponse

type SiteVerifyStringAPIModelResponse struct {
	Txt string `json:"txt"`
}

type TokenStruct

type TokenStruct struct {
	Token     string `json:"access_token"`
	ExpiresIn int    `json:"expires_in"`
	TokenType string `json:"token_type"`
	Scope     string `json:"scope"`
}

type VCLConfAPIModel added in v0.1.1

type VCLConfAPIModel struct {
	ID             int            `json:"id"`
	Company        int            `json:"company"`
	VCLCode        string         `json:"config_body"`
	UploadDate     string         `json:"upload_dt"`
	ProductionDate string         `json:"production_dt"`
	Validated      bool           `json:"validated"`
	Active         bool           `json:"active"`
	Deployed       bool           `json:"deployed"`
	CreatorUser    VCLConfCreator `json:"creator_user"`
}

type VCLConfCreator added in v0.1.1

type VCLConfCreator struct {
	ID        int    `json:"id"`
	Email     string `json:"email"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Username  string `json:"username"`
}

VCL Configs

Jump to

Keyboard shortcuts

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