api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NSExternal string = "external"
	NSHosted   string = "hosted"
)
View Source
const CHECK_STATUS_WAIT_TIME time.Duration = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Client *ovh.Client
	// contains filtered or unexported fields
}

func GetClient

func GetClient(data OVHCredentials, ctx context.Context) (*APIClient, error)

func (APIClient) CheckCurrentTaskState

func (c APIClient) CheckCurrentTaskState(serviceName string) error

func (APIClient) CheckOVHTask

func (c APIClient) CheckOVHTask(err chan<- error, domain string, id int64)

func (APIClient) DeleteNameServers

func (c APIClient) DeleteNameServers(serviceName string) error

func (APIClient) GetNameServersFromAPI

func (c APIClient) GetNameServersFromAPI(serviceName string) (map[string]NameServerOvhResponse, error)

func (APIClient) GetNameServersType

func (c APIClient) GetNameServersType(serviceName string) (NameServerType, error)

func (APIClient) SetNameServerType

func (c APIClient) SetNameServerType(serviceName string, nsType string) error

func (APIClient) UpdateNameServers

func (c APIClient) UpdateNameServers(serviceName string, data *NameServerUpdateRequest) (NameServerTask, error)

type NameServerCreatePayload

type NameServerCreatePayload struct {
	Host string `json:"host,omitempty"`
	IP   string `json:"ip,omitempty"`
}

type NameServerOvhResponse

type NameServerOvhResponse struct {
	Host     *string `json:"host,omitempty"`
	Id       int     `json:"id"`
	IP       *string `json:"ip,omitempty"`
	IsUsed   bool    `json:"isUsed"`
	ToDelete bool    `json:"toDelete"`
}

func (*NameServerOvhResponse) GetHost

func (n *NameServerOvhResponse) GetHost() string

func (*NameServerOvhResponse) GetIP

func (n *NameServerOvhResponse) GetIP() string

type NameServerTask

type NameServerTask struct {
	ID          int64  `json:"id"`
	ServiceName string `json:"domain"`
}

type NameServerType

type NameServerType struct {
	NameServerType string `json:"nameServerType"`
}

type NameServerUpdateRequest

type NameServerUpdateRequest struct {
	NameServers []*NameServerCreatePayload `json:"nameServers"`
}

type OVHCredentials

type OVHCredentials struct {
	Endpoint          string
	ApplicationKey    string
	ApplicationSecret string
	ConsumerKey       string
}

type OvhAuthCurrentCredential

type OvhAuthCurrentCredential struct {
	OvhSupport    bool             `json:"ovhSupport"`
	Status        string           `json:"status"`
	ApplicationId int64            `json:"applicationId"`
	CredentialId  int64            `json:"credentialId"`
	Rules         []ovh.AccessRule `json:"rules"`
	Expiration    time.Time        `json:"expiration"`
	LastUse       time.Time        `json:"lastUse"`
	Creation      time.Time        `json:"creation"`
}

type TaskReposnse

type TaskReposnse struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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