Documentation ¶
Overview ¶
JSON structs for Firebase Hosting API responses
GCS Google Cloud Storage API
Index ¶
- Constants
- Variables
- type AuthorizedHTTPClient
- func (client *AuthorizedHTTPClient) RestCreateVersion(site string) (r VersionCreateReturn, e error)
- func (client *AuthorizedHTTPClient) RestCreateVersionPopulateFiles(stagingDir string, versionId string) (vpfrs []VersionPopulateFilesReturn, err error)
- func (client *AuthorizedHTTPClient) RestReleasesCreate(site, versionId string) (r ReleasesCreateReturn, e error)
- func (client *AuthorizedHTTPClient) RestUploadFile(bodyFile io.Reader, shaHash, versionId string) error
- func (client *AuthorizedHTTPClient) RestUploadFileList(versionId string, manifestSet []VersionPopulateFilesReturn, stagingDir string) []error
- func (client *AuthorizedHTTPClient) RestVersionSetStatus(versionId string, status string) (r VersionStatusUpdateReturn, e error)
- func (aClient *AuthorizedHTTPClient) StorageDownload(bucket string, prefix string, target string, filter StorageFilter) error
- type JWTConfig
- type ReleasesCreateReturn
- type ResponseMessage
- type StorageFilter
- type VersionCreateReturn
- type VersionPopulateFilesRequestBody
- type VersionPopulateFilesReturn
- type VersionStatusUpdateRequestBody
- type VersionStatusUpdateReturn
Constants ¶
View Source
const REST_PAGE_SIZE = 1000
Variables ¶
View Source
var FlagConn *int
View Source
var StorageFilterImages = func(attrs *storage.ObjectAttrs) bool { for _, t := range imageContentTypes { if attrs.ContentType == t { return true } } return false }
filter only image types
Functions ¶
This section is empty.
Types ¶
type AuthorizedHTTPClient ¶
an http client with oauth2 credentials attached
func AuthorizeClientDefault ¶
func AuthorizeClientDefault(ctx context.Context) (*AuthorizedHTTPClient, error)
use ADC creds to authorize the default client
func (*AuthorizedHTTPClient) RestCreateVersion ¶
func (client *AuthorizedHTTPClient) RestCreateVersion(site string) (r VersionCreateReturn, e error)
rest call to create new version on Firebase Hosting
func (*AuthorizedHTTPClient) RestCreateVersionPopulateFiles ¶
func (client *AuthorizedHTTPClient) RestCreateVersionPopulateFiles(stagingDir string, versionId string) (vpfrs []VersionPopulateFilesReturn, err error)
rest populate files
func (*AuthorizedHTTPClient) RestReleasesCreate ¶
func (client *AuthorizedHTTPClient) RestReleasesCreate(site, versionId string) (r ReleasesCreateReturn, e error)
rest call create new release on firebase sites
func (*AuthorizedHTTPClient) RestUploadFile ¶
func (client *AuthorizedHTTPClient) RestUploadFile(bodyFile io.Reader, shaHash, versionId string) error
rest call to upload file contents
func (*AuthorizedHTTPClient) RestUploadFileList ¶
func (client *AuthorizedHTTPClient) RestUploadFileList(versionId string, manifestSet []VersionPopulateFilesReturn, stagingDir string) []error
rest call to upload file list to firebase
func (*AuthorizedHTTPClient) RestVersionSetStatus ¶
func (client *AuthorizedHTTPClient) RestVersionSetStatus(versionId string, status string) (r VersionStatusUpdateReturn, e error)
rest set status to published
func (*AuthorizedHTTPClient) StorageDownload ¶
func (aClient *AuthorizedHTTPClient) StorageDownload(bucket string, prefix string, target string, filter StorageFilter) error
download from GCS storage bucket
type JWTConfig ¶
type JWTConfig struct { Type string `json:"type"` ProjectID string `json:"project_id"` PrivateKeyID string `json:"private_key_id"` PrivateKey string `json:"private_key"` ClientEmail string `json:"client_email"` ClientID string `json:"client_id"` AuthURI string `json:"auth_uri"` TokenURI string `json:"token_uri"` AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"` ClientX509CertURL string `json:"client_x509_cert_url"` UniverseDomain string `json:"universe_domain"` }
type ReleasesCreateReturn ¶
type ReleasesCreateReturn struct { Name string `json:"name"` Version struct { Name string `json:"name"` Status string `json:"status"` Config struct { Headers []struct { Glob string `json:"glob"` Headers struct { CacheControl string `json:"Cache-Control"` } `json:"headers"` } `json:"headers"` } `json:"config"` } `json:"version"` Type string `json:"type"` ReleaseTime time.Time `json:"releaseTime"` }
type ResponseMessage ¶
type StorageFilter ¶
type StorageFilter func(attrs *storage.ObjectAttrs) bool
client-side filter function
type VersionCreateReturn ¶
type VersionCreateReturn struct { Name string `json:"name"` Status string `json:"status"` Config struct { Headers []struct { Glob string `json:"glob"` Headers struct { CacheControl string `json:"Cache-Control"` } `json:"headers"` } `json:"headers"` } `json:"config"` }
create version call
type VersionPopulateFilesRequestBody ¶
Populate Files request
type VersionPopulateFilesReturn ¶
type VersionPopulateFilesReturn struct { UploadRequiredHashes []string `json:"uploadRequiredHashes"` UploadURL string `json:"uploadUrl"` }
Populate Files Response
type VersionStatusUpdateRequestBody ¶
type VersionStatusUpdateRequestBody struct {
Status string `json:"status"`
}
Version Status Update Request
type VersionStatusUpdateReturn ¶
type VersionStatusUpdateReturn struct { Name string `json:"name"` Status string `json:"status"` Config struct { Headers []struct { Glob string `json:"glob"` Headers struct { CacheControl string `json:"Cache-Control"` } `json:"headers"` } `json:"headers"` } `json:"config"` CreateTime time.Time `json:"createTime"` CreateUser struct { Email string `json:"email"` } `json:"createUser"` FinalizeTime time.Time `json:"finalizeTime"` FinalizeUser struct { Email string `json:"email"` } `json:"finalizeUser"` FileCount string `json:"fileCount"` VersionBytes string `json:"versionBytes"` }
Click to show internal directories.
Click to hide internal directories.