cert

package
v0.9.149 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Overview

cert.go - the certificate APIs definition supported by the Cert service

Package cert defines the Cert services of BCE. The supported APIs are all defined in sub-package

Index

Constants

View Source
const (
	URI_PREFIX       = bce.URI_PREFIX + "v1"
	DEFAULT_ENDPOINT = "certificate.baidubce.com"
	REQUEST_CERT_URL = "/certificate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateMeta

type CertificateMeta struct {
	CertId         string `json:"certId"`
	CertName       string `json:"certName"`
	CertCommonName string `json:"certCommonName"`
	CertStartTime  string `json:"certStartTime"`
	CertStopTime   string `json:"certStopTime"`
	CertCreateTime string `json:"certCreateTime"`
	CertUpdateTime string `json:"certUpdateTime"`
	CertType       int    `json:"certType"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of Cert service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) CreateCert

func (c *Client) CreateCert(args *CreateCertArgs) (*CreateCertResult, error)

CreateCert - create a cert with the specific parameters

PARAMS:

  • args: the arguments to create a cert

RETURNS:

  • *CreateCertResult: the result of create Cert, contains new Cert's ID
  • error: nil if success otherwise the specific error

func (*Client) DeleteCert

func (c *Client) DeleteCert(id string) error

DeleteCert - delete a specific cert

PARAMS:

  • id: the specific cert's ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetCertMeta

func (c *Client) GetCertMeta(id string) (*CertificateMeta, error)

GetCertMeta - get a specific cert's meta

PARAMS:

  • id: the specific cert's ID

RETURNS:

  • *CertificateMeta: the specific cert's meta with
  • error: nil if success otherwise the specific error

func (*Client) ListCerts

func (c *Client) ListCerts() (*ListCertResult, error)

ListCerts - list all certs

RETURNS:

  • *ListCertResult: the result of list all certs, contains all certs' meta
  • error: nil if success otherwise the specific error

func (*Client) UpdateCertData

func (c *Client) UpdateCertData(id string, args *UpdateCertDataArgs) error

UpdateCertData - update a specific cert's data, include update key

PARAMS:

  • id: the specific cert's ID
  • args: the arguments to update a specific cert

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateCertName

func (c *Client) UpdateCertName(id string, args *UpdateCertNameArgs) error

UpdateCertName - update a cert's name

PARAMS:

  • id: the specific cert's ID
  • args: the arguments to update a cert's name

RETURNS:

  • error: nil if success otherwise the specific error

type CreateCertArgs

type CreateCertArgs struct {
	CertName        string `json:"certName"`
	CertServerData  string `json:"certServerData"`
	CertPrivateData string `json:"certPrivateData"`
	CertLinkData    string `json:"certLinkData,omitempty"`
	CertType        int    `json:"certType,omitempty"`
}

type CreateCertResult

type CreateCertResult struct {
	CertName string `json:"certName"`
	CertId   string `json:"certId"`
}

type ListCertResult

type ListCertResult struct {
	Certs []CertificateMeta `json:"certs"`
}

type UpdateCertDataArgs

type UpdateCertDataArgs struct {
	CertName        string `json:"certName"`
	CertServerData  string `json:"certServerData"`
	CertPrivateData string `json:"certPrivateData"`
	CertLinkData    string `json:"certLinkData,omitempty"`
	CertType        int    `json:"certType,omitempty"`
}

type UpdateCertNameArgs

type UpdateCertNameArgs struct {
	CertName string `json:"certName"`
}

Jump to

Keyboard shortcuts

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