webaccel

package module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 2 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

[!WARNING]

このレポジトリの内容は下記に集約・移転しました。 github.com/sacloud/sacloud-sdk-go

今後は上記のレポジトリで開発を行います。 このライブラリを使用している方は、importを変更していただきますようお願いいたします。

// 変更前
import "github.com/sacloud/webaccel-api-go"

// 変更後
import "github.com/sacloud/sacloud-sdk-go/api/webaccel"

webaccel-api-go

Go Reference Tests Go Report Card

ウェブアクセラレータ の API をGo言語から扱うためのライブラリ

Overview

従来はiaas-api-go(libsacloud v2)で提供していたAPIライブラリを独立したリポジトリとして切り出したものです。

webaccel-api-goを利用したクライアントコードの例
package example

import (
	"context"
	"log"

	"github.com/sacloud/webaccel-api-go"
)

func Example() {
	// デフォルトではusacloudプロファイルや環境変数が利用される。
	// パラメータを指定することで上書きしたり無効化したりできる
	client := &webaccel.Client{
		//Profile:           "default",
		//AccessToken:       "token",
		//AccessTokenSecret: "secret",
		//DisableProfile:    false,
		//DisableEnv:        false,
	}
	op := webaccel.NewOp(client)

	// サイト一覧
	found, err := op.List(context.Background())
	if err != nil {
		panic(err)
	}
	log.Println(found)

	// 全キャッシュ削除
	deleteAllCacheRequest := &webaccel.DeleteAllCacheRequest{
		Domain: "example.com",
	}
	if err := op.DeleteAllCache(context.Background(), deleteAllCacheRequest); err != nil {
		panic(err)
	}

	// URLごとにキャッシュ削除
	deleteCacheRequest := &webaccel.DeleteCacheRequest{
		URL: []string{
			"https://example.com/url1",
			"https://example.com/url2",
		},
	}
	if _, err := op.DeleteCache(context.Background(), deleteCacheRequest); err != nil {
		panic(err)
	}
}

Installation

Use go get.

go get github.com/sacloud/webaccel-api-go

Then import the webaccel package into your own code.

import "github.com/sacloud/webaccel-api-go"

License

webaccel-api-go Copyright 2022-2025 The webaccel-api-go authors.

This project is published under Apache 2.0 License.

Documentation

Overview

Deprecated: This module has moved to github.com/sacloud/sacloud-sdk-go. Please migrate to that module. This repository will be archived.

Index

Constants

View Source
const (
	OriginTypesWebServer     = "0" // ウェブサーバ
	OriginTypesObjectStorage = "1" // オブジェクトストレージ
)

OriginType

View Source
const (
	RequestProtocolsHttpAndHttps    = "0" // http/https
	RequestProtocolsHttpsOnly       = "1" // httpsのみ
	RequestProtocolsRedirectToHttps = "2" // httpsに」リダイレクト
)

RequestProtocol

View Source
const (
	OriginProtocolsHttp  = "http"
	OriginProtocolsHttps = "https"
)

OriginProtocol

View Source
const (
	VarySupportDisabled = "0" // 無効
	VarySupportEnabled  = "1" // 有効
)

VarySupport

View Source
const (
	DocIndexDisabled = "0" // 無効
	DocIndexEnabled  = "1" // 有効
)

DocIndex

View Source
const (
	NormalizeAEGz   = "1" // gzipに正規化
	NormalizeAEBrGz = "3" // brとgzipの組に正規化
)

NormalizeAE

View Source
const (
	// DefaultAPIRootURL デフォルトのAPIルートURL
	DefaultAPIRootURL = "https://secure.sakura.ad.jp/cloud/zone/is1a/api/webaccel/1.0/"
)

Variables

View Source
var (
	// NormalizeAENicknameStrings
	// NormalizeAEパラメタの文字列表現。APIリクエストには直接指定できないことに注意。
	// MapNormalizeAENicknameToValue を用いてAPIリクエストに指定する値に変換できる。
	NormalizeAENicknameStrings = []string{
		gunzipCompressionNickname,
		brotliCompressionNickname,
	}
	// RequestProtocolStrings
	// RequestProtocolパラメタの文字列表現。APIリクエストには直接指定できないことに注意。
	// MapRequestProtocolNicknameToValue を用いてAPIリクエストに指定する値に変換できる。
	RequestProtocolStrings = []string{
		httpOrHttpsRequestProtocolNickname,
		httpsOnlyRequestProtocolNickname,
		httpsRedirectedRequestProtocolNickname,
	}
	// OriginProtocolStrings
	// OriginProtocolパラメタの文字列表現。いずれかの値をAPIリクエストに直接指定できる。
	OriginProtocolStrings = []string{
		OriginProtocolsHttp,
		OriginProtocolsHttps,
	}
)
View Source
var UserAgent = fmt.Sprintf(
	"webaccel-api-go/v%s (%s/%s; +https://github.com/sacloud/webaccel-api-go) %s",
	Version,
	runtime.GOOS,
	runtime.GOARCH,
	client.DefaultUserAgent,
)

UserAgent APIリクエスト時のユーザーエージェント

View Source
var (
	// Version app version
	Version = "1.5.1"
)

Functions

func IsNotFoundError added in v1.1.2

func IsNotFoundError(err error) bool

IsNotFoundError 指定のerrorがAPI呼び出し時の404エラーであるか判定

func MapNormalizeAENicknameToValue added in v1.4.0

func MapNormalizeAENicknameToValue(compressionNickname string) (string, error)

MapNormalizeAENicknameToValue maps compression type nickname (e.g. br+gzip) to string const which is acceptable as a parameter of Site.

func MapNormalizeAEValueToNickname added in v1.4.0

func MapNormalizeAEValueToNickname(site *Site) (string, error)

MapNormalizeAEValueToNickname maps the site's accept-encoding normalization parameter value into human-readable nickname such as `gzip`.

func MapRequestProtocolNicknameToValue added in v1.4.0

func MapRequestProtocolNicknameToValue(protocolNickname string) (string, error)

MapRequestProtocolNicknameToValue maps non-origin request protocol nickname (e.g. http+https) to a string const which is acceptable as a parameter of Site.

func MapRequestProtocolToNickname added in v1.4.0

func MapRequestProtocolToNickname(site *Site) (string, error)

MapRequestProtocolToNickname maps the site's (non-origin) request protocol value (e.g. `1`) into human-readable string format such as `https`.

Types

type ACLResult added in v1.2.0

type ACLResult struct {
	ACL string
}

type API

type API interface {
	List(ctx context.Context) (*ListSitesResult, error)
	Create(ctx context.Context, param *CreateSiteRequest) (*Site, error)
	Read(ctx context.Context, id string) (*Site, error)
	Update(ctx context.Context, id string, param *UpdateSiteRequest) (*Site, error)
	UpdateStatus(ctx context.Context, id string, param *UpdateSiteStatusRequest) (*Site, error)
	CreateOriginGuardToken(ctx context.Context, id string) (*OriginGuardTokenResponse, error)
	DeleteOriginGuardToken(ctx context.Context, id string) error
	CreateNextOriginGuardToken(ctx context.Context, id string) (*OriginGuardTokenResponse, error)
	DeleteNextOriginGuardToken(ctx context.Context, id string) error
	CreateAutoCertUpdate(ctx context.Context, id string) error
	DeleteAutoCertUpdate(ctx context.Context, id string) error
	ReadACL(ctx context.Context, id string) (*ACLResult, error)
	UpsertACL(ctx context.Context, id string, acl string) (*ACLResult, error)
	DeleteACL(ctx context.Context, id string) error
	ReadCertificate(ctx context.Context, id string) (*Certificates, error)
	CreateCertificate(ctx context.Context, id string, param *CreateOrUpdateCertificateRequest) (*Certificates, error)
	UpdateCertificate(ctx context.Context, id string, param *CreateOrUpdateCertificateRequest) (*Certificates, error)
	DeleteCertificate(ctx context.Context, id string) error
	DeleteAllCache(ctx context.Context, param *DeleteAllCacheRequest) error
	DeleteCache(ctx context.Context, param *DeleteCacheRequest) ([]*DeleteCacheResult, error)
	Delete(ctx context.Context, id string) (*Site, error)
	MonthlyUsage(ctx context.Context, targetYM string) (*MonthlyUsageResults, error)
	ApplyLogUploadConfig(ctx context.Context, id string, param *LogUploadConfig) (*LogUploadConfig, error)
	ReadLogUploadConfig(ctx context.Context, id string) (*LogUploadConfig, error)
	DeleteLogUploadConfig(ctx context.Context, id string) error
}

API is interface for operate WebAccel resource

func NewOp

func NewOp(caller APICaller) API

NewOp creates new Op instance

type APICaller

type APICaller interface {
	Do(ctx context.Context, method, uri string, body interface{}) ([]byte, error)
	RootURL() string
}

type APIError

type APIError interface {
	// errorインターフェースを内包
	error

	// ResponseCode エラー発生時のレスポンスコード
	ResponseCode() int

	// Code エラーコード
	Code() string

	// Message エラー発生時のメッセージ
	Message() string

	// Serial エラー追跡用シリアルコード
	Serial() string

	// OriginalError エラー(オリジナル)
	OriginalError() *APIErrorResponse
}

APIError APIコール時のエラー情報

func NewAPIError

func NewAPIError(requestMethod string, requestURL *url.URL, responseCode int, err *APIErrorResponse) APIError

NewAPIError APIコール時のエラー情報

type APIErrorResponse

type APIErrorResponse struct {
	IsFatal      bool   `json:"is_fatal,omitempty"`   // IsFatal
	Serial       string `json:"serial,omitempty"`     // Serial
	Status       string `json:"status,omitempty"`     // Status
	ErrorCode    string `json:"error_code,omitempty"` // ErrorCode
	ErrorMessage string `json:"error_msg,omitempty"`  // ErrorMessage
}

APIErrorResponse APIエラー型

type CORSRule added in v1.1.0

type CORSRule struct {
	AllowsAnyOrigin bool     // trueの場合全オリジンを許可
	AllowedOrigins  []string `validate:"omitempty,max=4"`
}

CORSRule .

type Certificates

type Certificates struct {
	Current *CurrentCertificate
	Old     []*OldCertificate
}

Certificates 証明書

func (*Certificates) UnmarshalJSON added in v1.1.3

func (w *Certificates) UnmarshalJSON(data []byte) error

UnmarshalJSON JSONアンマーシャル(配列、オブジェクトが混在するためここで対応)

type Client

type Client struct {
	// Profile usacloud互換プロファイル名
	Profile string

	// APIRootURL APIのリクエスト先URLプレフィックス、省略可能
	APIRootURL string

	// AccessToken APIキー:トークン
	// Optionsでの指定より優先される
	AccessToken string
	// AccessTokenSecret APIキー:シークレット
	// Optionsでの指定より優先される
	AccessTokenSecret string

	// Options HTTPクライアント関連オプション
	Options *client.Options

	// DisableProfile usacloud互換プロファイルからの設定読み取りを無効化
	DisableProfile bool

	// DisableEnv 環境変数からの設定読み取りを無効化
	DisableEnv bool

	Saclient saclient.ClientAPI
	// contains filtered or unexported fields
}

Client APIクライアント

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, uri string, body interface{}) ([]byte, error)

Do APIコール実施

func (*Client) RootURL

func (c *Client) RootURL() string

type CreateOrUpdateCertificateRequest

type CreateOrUpdateCertificateRequest struct {
	CertificateChain string
	Key              string
}

CreateOrUpdateCertificateRequest .

type CreateSiteRequest added in v1.3.0

type CreateSiteRequest struct {
	// 「オリジン種別」に関係なく設定できる共通項目
	Name            string `json:",omitempty"`
	OriginType      string `json:",omitempty" validate:"omitempty,oneof=0 1"` // 0:ウェブサーバ, 1:オブジェクトストレージ
	Domain          string `json:",omitempty" validate:"omitempty"`           // 独自ドメインを設定する場合のみ
	DomainType      string `json:",omitempty" validate:"omitempty,oneof=own_domain subdomain"`
	RequestProtocol string `json:",omitempty" validate:"omitempty,oneof=0 1 2"` // 0:http/https, 1:httpsのみ, 2:httpsにリダイレクト
	OriginProtocol  string `json:",omitempty" validate:"omitempty,oneof=http https"`
	DefaultCacheTTL *int   `json:",omitempty" validate:"omitempty,min=-1,max=604800"` // -1:無効, 0 ~ 604800 の範囲内の数値: デフォルトのキャッシュ期間(秒)
	VarySupport     string `json:",omitempty" validate:"omitempty,oneof=0 1"`         // 0:無効, 1:有効
	NormalizeAE     string `json:",omitempty" validate:"omitempty,oneof=1 3"`         // 1:Accept-Encodingをgzipに正規化, 3:bzとgzipの組に正規化

	// 「オリジン種別」が「ウェブサーバ」の場合に設定可能な項目
	Origin     string `json:",omitempty"`
	HostHeader string `json:",omitempty"`

	// 「オリジン種別」が「オブジェクトストレージ」の場合に設定可能な項目
	BucketName      string `json:",omitempty"`
	S3Endpoint      string `json:",omitempty"`
	S3Region        string `json:",omitempty"`
	DocIndex        string `json:",omitempty" validate:"omitempty,oneof=0 1"` // 0:無効, 1:有効
	AccessKeyID     string `json:",omitempty"`
	SecretAccessKey string `json:",omitempty"`
}

CreateSiteRequest サイト作成リクエスト

type CurrentCertificate

type CurrentCertificate struct {
	ID                string
	SiteID            string
	CertificateChain  string
	Key               string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	SerialNumber      string
	NotBefore         int64
	NotAfter          int64
	Issuer            *Issuer
	Subject           *Subject
	DNSNames          []string
	SHA256Fingerprint string
}

CurrentCertificate 現在有効な証明書

type DeleteAllCacheRequest

type DeleteAllCacheRequest struct {
	Domain string
}

DeleteAllCacheRequest .

type DeleteCacheRequest

type DeleteCacheRequest struct {
	URL []string
}

DeleteCacheRequest .

type DeleteCacheResult

type DeleteCacheResult struct {
	URL    string
	Status int
	Result string
}

DeleteCacheResult .

type Issuer

type Issuer struct {
	Country            string
	Organization       string
	OrganizationalUnit string
	CommonName         string
}

Issuer .

type ListSitesResult

type ListSitesResult struct {
	Total int `json:",omitempty"` // Total count of target resources
	From  int `json:",omitempty"` // Current page number
	Count int `json:",omitempty"` // Count of current page

	Sites []*Site `json:",omitempty"`
}

ListSitesResult .

type LogUploadConfig added in v1.3.0

type LogUploadConfig struct {
	Bucket          string `json:","`
	Endpoint        string `json:"," validate:",equal=https://s3.isk01.sakurastorage.jp"`
	Region          string `json:"," validate:",equal=jp-north-1"`
	AccessKeyID     string `json:","`
	SecretAccessKey string `json:","`
	Status          string `json:"," validate:"oneof=enabled disabled"`
}

LogUploadConfig ログアップロード設定

type MonthlyUsage added in v1.1.0

type MonthlyUsage struct {
	SiteID             json.Number
	Domain             string
	ASCIIDomain        string
	Subdomain          string
	AccessCount        int64
	BytesSent          int64
	CacheMissBytesSent int64
	CacheHitRatio      float64
	BytesCacheHitRatio float64
	Price              int64
}

type MonthlyUsageResults added in v1.1.0

type MonthlyUsageResults struct {
	Year          int
	Month         int
	MonthlyUsages []*MonthlyUsage
}

MonthlyUsageResults 月別使用量

type OldCertificate

type OldCertificate struct {
	ID                string
	SiteID            string
	CertificateChain  string
	Key               string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	SerialNumber      string
	NotBefore         int64
	NotAfter          int64
	Issuer            *Issuer
	Subject           *Subject
	DNSNames          []string
	SHA256Fingerprint string
}

OldCertificate .

type Op

type Op struct {
	Client APICaller
}

Op implements WebAccelAPI interface

func (*Op) ApplyLogUploadConfig added in v1.3.0

func (o *Op) ApplyLogUploadConfig(ctx context.Context, id string, param *LogUploadConfig) (*LogUploadConfig, error)

ApplyLogUploadConfig ログアップロード設定を作成・更新

func (*Op) Create added in v1.3.0

func (o *Op) Create(ctx context.Context, param *CreateSiteRequest) (*Site, error)

Create 新規サイトの作成

func (*Op) CreateAutoCertUpdate added in v1.3.0

func (o *Op) CreateAutoCertUpdate(ctx context.Context, id string) error

CreateAutoCertUpdate Let's Encrypt 自動更新証明書有効化

func (*Op) CreateCertificate

func (o *Op) CreateCertificate(ctx context.Context, id string, param *CreateOrUpdateCertificateRequest) (*Certificates, error)

CreateCertificate サイトに証明書を登録

func (*Op) CreateNextOriginGuardToken added in v1.3.0

func (o *Op) CreateNextOriginGuardToken(ctx context.Context, id string) (*OriginGuardTokenResponse, error)

CreateNextOriginGuardToken オリジンガードトークンの次期トークン作成

func (*Op) CreateOriginGuardToken added in v1.3.0

func (o *Op) CreateOriginGuardToken(ctx context.Context, id string) (*OriginGuardTokenResponse, error)

CreateOriginGuardToken オリジンガードトークンの発行・更新

func (*Op) Delete added in v1.3.0

func (o *Op) Delete(ctx context.Context, id string) (*Site, error)

Delete サイト削除

func (*Op) DeleteACL added in v1.2.0

func (o *Op) DeleteACL(ctx context.Context, id string) error

DeleteACL サイトのACLの削除

func (*Op) DeleteAllCache

func (o *Op) DeleteAllCache(ctx context.Context, param *DeleteAllCacheRequest) error

DeleteAllCache 全キャッシュ削除

func (*Op) DeleteAutoCertUpdate added in v1.3.0

func (o *Op) DeleteAutoCertUpdate(ctx context.Context, id string) error

DeleteAutoCertUpdate Let's Encrypt 自動更新証明書無効化

func (*Op) DeleteCache

func (o *Op) DeleteCache(ctx context.Context, param *DeleteCacheRequest) ([]*DeleteCacheResult, error)

DeleteCache URLごとにキャッシュ削除

func (*Op) DeleteCertificate

func (o *Op) DeleteCertificate(ctx context.Context, id string) error

DeleteCertificate サイトの証明書を削除

func (*Op) DeleteLogUploadConfig added in v1.3.0

func (o *Op) DeleteLogUploadConfig(ctx context.Context, id string) error

DeleteLogUploadConfig ログアップロードを削除

func (*Op) DeleteNextOriginGuardToken added in v1.3.0

func (o *Op) DeleteNextOriginGuardToken(ctx context.Context, id string) error

DeleteNextOriginGuardToken オリジンガードトークンの次期トークン更新キャンセル

func (*Op) DeleteOriginGuardToken added in v1.3.0

func (o *Op) DeleteOriginGuardToken(ctx context.Context, id string) error

DeleteOriginGuardToken オリジンガードトークンの削除

func (*Op) List

func (o *Op) List(ctx context.Context) (*ListSitesResult, error)

List サイト一覧

NOTE: 各サイトのCORSRulesはnullになる点に注意

func (*Op) MonthlyUsage added in v1.1.0

func (o *Op) MonthlyUsage(ctx context.Context, targetYM string) (*MonthlyUsageResults, error)

MonthlyUsage クラウドアカウントに登録されている全サイトの月別使用量を取得する。

targetフィールドの値は「yyyymm」形式で対象年月を指定する。 (例: 2021年02月の場合は、「202102」と指定。) 指定がない場合は、今月の月別使用量を取得する。

func (*Op) Read

func (o *Op) Read(ctx context.Context, id string) (*Site, error)

Read サイト詳細

func (*Op) ReadACL added in v1.2.0

func (o *Op) ReadACL(ctx context.Context, id string) (*ACLResult, error)

ReadACL サイトのACL取得

func (*Op) ReadCertificate

func (o *Op) ReadCertificate(ctx context.Context, id string) (*Certificates, error)

ReadCertificate サイト証明書の参照

func (*Op) ReadLogUploadConfig added in v1.3.0

func (o *Op) ReadLogUploadConfig(ctx context.Context, id string) (*LogUploadConfig, error)

ReadLogUploadConfig ログアップロードを取得

func (*Op) Update added in v1.1.0

func (o *Op) Update(ctx context.Context, id string, param *UpdateSiteRequest) (*Site, error)

Update サイト更新

func (*Op) UpdateCertificate

func (o *Op) UpdateCertificate(ctx context.Context, id string, param *CreateOrUpdateCertificateRequest) (*Certificates, error)

UpdateCertificate サイトの証明書を更新

func (*Op) UpdateStatus added in v1.3.0

func (o *Op) UpdateStatus(ctx context.Context, id string, param *UpdateSiteStatusRequest) (*Site, error)

UpdateStatus サイト有効化状態の更新

func (*Op) UpsertACL added in v1.2.0

func (o *Op) UpsertACL(ctx context.Context, id string, acl string) (*ACLResult, error)

UpsertACL サイトのACLの登録/更新

type OriginGuardTokenResponse added in v1.3.0

type OriginGuardTokenResponse struct {
	OriginGuardToken     string `json:","`
	NextOriginGuardToken string `json:","`
}

OriginGuardTokenResponse サイトのオリジンガードトークン取得レスポンス

type Site

type Site struct {
	ID   string
	Name string

	DomainType      string `validate:"oneof=own_domain subdomain"`
	Domain          string
	Subdomain       string
	ASCIIDomain     string
	RequestProtocol string // 0:http/https, 1:httpsのみ, 2:httpsにリダイレクト
	DefaultCacheTTL int    `validate:"min=-1,max=604800"` // -1:無効, 0 ~ 604800 の範囲内の数値: デフォルトのキャッシュ期間(秒)
	VarySupport     string // 0:無効, 1:有効
	// NOTE: List()だと空、Read()でのみ参照可能
	NormalizeAE string // 1:Accept-Encodingをgzipに正規化, 3:bzとgzipの組に正規化

	OriginType           string // 0:ウェブサーバ, 1:オブジェクトストレージ
	Origin               string
	OriginProtocol       string
	HostHeader           string
	OriginGuardToken     string
	NextOriginGuardToken string

	// オブジェクトストレージをオリジンにする場合
	BucketName string
	S3Endpoint string
	S3Region   string
	DocIndex   string // 0:無効, 1:有効

	// CORSRules ルール一覧、設定されている場合単一要素を持つ配列となる
	// NOTE: List()だと空、Read()でのみ参照可能
	CORSRules         []*CORSRule
	OnetimeURLSecrets []string

	Status             string `validate:"oneof=enabled disabled"`
	HasCertificate     bool
	HasOldCertificate  bool
	GibSentInLastWeek  int64
	CertValidNotBefore int64
	CertValidNotAfter  int64
	CreatedAt          time.Time
}

Site サイト

type Subject

type Subject struct {
	Country            string
	Organization       string
	OrganizationalUnit string
	Locality           string
	Province           string
	StreetAddress      string
	PostalCode         string
	SerialNumber       string
	CommonName         string
}

Subject .

type UpdateSiteRequest added in v1.1.0

type UpdateSiteRequest struct {
	// 「オリジン種別」に関係なく設定できる共通項目
	Name            string `json:",omitempty"`
	OriginType      string `json:",omitempty" validate:"omitempty,oneof=0 1"`   // 0:ウェブサーバ, 1:オブジェクトストレージ
	RequestProtocol string `json:",omitempty" validate:"omitempty,oneof=0 1 2"` // 0:http/https, 1:httpsのみ, 2:httpsにリダイレクト
	OriginProtocol  string `json:",omitempty" validate:"omitempty,oneof=http https"`
	DefaultCacheTTL *int   `json:",omitempty" validate:"omitempty,min=-1,max=604800"` // -1:無効, 0 ~ 604800 の範囲内の数値: デフォルトのキャッシュ期間(秒)
	VarySupport     string `json:",omitempty" validate:"omitempty,oneof=0 1"`         // 0:無効, 1:有効
	NormalizeAE     string `json:",omitempty" validate:"omitempty,oneof=1 3"`         // 1:Accept-Encodingをgzipに正規化, 3:bzとgzipの組に正規化

	// CORSRules ルール一覧、設定されている場合単一要素を持つ配列となる
	CORSRules         *[]*CORSRule `json:",omitempty"`
	OnetimeURLSecrets *[]string    `json:",omitempty"`

	// 「オリジン種別」が「ウェブサーバ」の場合に設定可能な項目
	Origin     string `json:",omitempty"`
	HostHeader string `json:",omitempty"`

	// 「オリジン種別」が「オブジェクトストレージ」の場合に設定可能な項目
	BucketName      string `json:",omitempty"`
	S3Endpoint      string `json:",omitempty"`
	S3Region        string `json:",omitempty"`
	DocIndex        string `json:",omitempty" validate:"omitempty,oneof=0 1"` // 0:無効, 1:有効
	AccessKeyID     string `json:",omitempty"`
	SecretAccessKey string `json:",omitempty"`
}

UpdateSiteRequest サイト更新リクエスト

type UpdateSiteStatusRequest added in v1.3.0

type UpdateSiteStatusRequest struct {
	Status string `validate:"oneof=enabled disabled"`
}

UpdateSiteStatusRequest サイトの有効化状態更新リクエスト

Jump to

Keyboard shortcuts

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