Documentation
¶
Index ¶
- func IsNil(i interface{}) bool
- type CertificateResource
- type CertificateService
- func (s *CertificateService) Add(certificate *CertificateResource) (*CertificateResource, error)
- func (s *CertificateService) Archive(resource *CertificateResource) (*CertificateResource, error)
- func (s *CertificateService) Get(certificatesQuery CertificatesQuery) (*resources.Resources[*CertificateResource], error)
- func (s *CertificateService) GetAll() ([]*CertificateResource, error)
- func (s *CertificateService) GetByID(id string) (*CertificateResource, error)
- func (s *CertificateService) Replace(certificateID string, replacementCertificate *ReplacementCertificate) (*CertificateResource, error)
- func (s *CertificateService) Unarchive(resource *CertificateResource) (*CertificateResource, error)
- func (s *CertificateService) Update(resource CertificateResource) (*CertificateResource, error)
- type CertificatesQuery
- type ReplacementCertificate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertificateResource ¶
type CertificateResource struct {
Archived string `json:"Archived,omitempty"`
CertificateData *core.SensitiveValue `json:"CertificateData,omitempty" validate:"required"`
CertificateDataFormat string `json:"CertificateDataFormat,omitempty"`
EnvironmentIDs []string `json:"EnvironmentIds,omitempty"`
HasPrivateKey bool `json:"HasPrivateKey"`
IsExpired bool `json:"IsExpired"`
IssuerCommonName string `json:"IssuerCommonName,omitempty"`
IssuerDistinguishedName string `json:"IssuerDistinguishedName,omitempty"`
IssuerOrganization string `json:"IssuerOrganization,omitempty"`
Name string `json:"Name,omitempty" validate:"required"`
NotAfter string `json:"NotAfter,omitempty"`
NotBefore string `json:"NotBefore,omitempty"`
Notes string `json:"Notes,omitempty"`
Password *core.SensitiveValue `json:"Password,omitempty"`
ReplacedBy string `json:"ReplacedBy,omitempty"`
SelfSigned bool `json:"SelfSigned"`
SerialNumber string `json:"SerialNumber,omitempty"`
SignatureAlgorithmName string `json:"SignatureAlgorithmName,omitempty"`
SpaceID string `json:"SpaceId,omitempty"`
SubjectAlternativeNames []string `json:"SubjectAlternativeNames,omitempty"`
SubjectCommonName string `json:"SubjectCommonName,omitempty"`
SubjectDistinguishedName string `json:"SubjectDistinguishedName,omitempty"`
SubjectOrganization string `json:"SubjectOrganization,omitempty"`
TenantedDeploymentMode core.TenantedDeploymentMode `json:"TenantedDeploymentParticipation"`
TenantIDs []string `json:"TenantIds,omitempty"`
TenantTags []string `json:"TenantTags,omitempty"`
Thumbprint string `json:"Thumbprint,omitempty"`
Version int `json:"Version,omitempty"`
resources.Resource
}
func NewCertificateResource ¶
func NewCertificateResource(name string, certificateData *core.SensitiveValue, password *core.SensitiveValue) *CertificateResource
NewCertificateResource initializes a certificate resource with a name and credentials.
func (CertificateResource) Validate ¶
func (c CertificateResource) Validate() error
Validate checks the state of the certificate resource and returns an error if invalid.
type CertificateService ¶
type CertificateService struct {
services.CanDeleteService
}
certificateService handles communication with Certificate-related methods of the Octopus API.
func NewCertificateService ¶
func NewCertificateService(sling *sling.Sling, uriTemplate string) *CertificateService
NewCertificateService returns an certificateService with a preconfigured client.
func (*CertificateService) Add ¶
func (s *CertificateService) Add(certificate *CertificateResource) (*CertificateResource, error)
Add creates a new certificate.
func (*CertificateService) Archive ¶
func (s *CertificateService) Archive(resource *CertificateResource) (*CertificateResource, error)
Archive sets the status of a certificate to an archived state.
func (*CertificateService) Get ¶
func (s *CertificateService) Get(certificatesQuery CertificatesQuery) (*resources.Resources[*CertificateResource], error)
Get returns a collection of certificates based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.
func (*CertificateService) GetAll ¶
func (s *CertificateService) GetAll() ([]*CertificateResource, error)
GetAll returns all certificates. If none are found or an error occurs, it returns an empty collection.
func (*CertificateService) GetByID ¶
func (s *CertificateService) GetByID(id string) (*CertificateResource, error)
GetByID returns the certificate that matches the input ID. If one cannot be found, it returns nil and an error.
func (*CertificateService) Replace ¶
func (s *CertificateService) Replace(certificateID string, replacementCertificate *ReplacementCertificate) (*CertificateResource, error)
func (*CertificateService) Unarchive ¶
func (s *CertificateService) Unarchive(resource *CertificateResource) (*CertificateResource, error)
Unarchive resets the status of an archived certificate.
func (*CertificateService) Update ¶
func (s *CertificateService) Update(resource CertificateResource) (*CertificateResource, error)
Update modifies a Certificate based on the one provided as input.
type CertificatesQuery ¶
type CertificatesQuery struct {
Archived string `uri:"archived,omitempty" url:"archived,omitempty"`
FirstResult string `uri:"firstResult,omitempty" url:"firstResult,omitempty"`
IDs []string `uri:"ids,omitempty" url:"ids,omitempty"`
OrderBy string `uri:"orderBy,omitempty" url:"orderBy,omitempty"`
PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"`
Search string `uri:"search,omitempty" url:"search,omitempty"`
Skip int `uri:"skip,omitempty" url:"skip,omitempty"`
Take int `uri:"take,omitempty" url:"take,omitempty"`
Tenant string `uri:"tenant,omitempty" url:"tenant,omitempty"`
}
type ReplacementCertificate ¶
type ReplacementCertificate struct {
CertificateData string `json:"CertificateData,omitempty"`
Password string `json:"Password,omitempty"`
}
func NewReplacementCertificate ¶
func NewReplacementCertificate(certificateData string, password string) *ReplacementCertificate