Documentation ¶
Index ¶
Constants ¶
const ( AkamaiClusterAmsterdam = "nl-ams-1.linodeobjects.com" AkamaiClusterAtlanta = "us-southeast-1.linodeobjects.com" AkamaiClusterChennai = "in-maa-1.linodeobjects.com" AkamaiClusterChicago = "us-ord-1.linodeobjects.com" AkamaiClusterFrankfurt = "eu-central-1.linodeobjects.com" AkamaiClusterJakarta = "id-cgk-1.linodeobjects.com" AkamaiClusterLosAngeles = "us-lax-1.linodeobjects.com" AkamaiClusterMiami = "us-mia-1.linodeobjects.com" AkamaiClusterMilan = "it-mil-1.linodeobjects.com" AkamaiClusterNewark = "us-east-1.linodeobjects.com" AkamaiClusterOsaka = "jp-osa-1.linodeobjects.com" AkamaiClusterParis = "fr-par-1.linodeobjects.com" AkamaiClusterSaoPaulo = "br-gru-1.linodeobjects.com" AkamaiClusterSeattle = "us-sea-1.linodeobjects.com" AkamaiClusterSingapore = "ap-south-1.linodeobjects.com" AkamaiClusterStockholm = "se-sto-1.linodeobjects.com" AkamaiClusterAshburn = "us-iad-1.linodeobjects.com" )
const ( AkamaiRegionAmsterdam = "nl-ams-1" AkamaiRegionAtlanta = "us-southeast-1" AkamaiRegionChennai = "in-maa-1" AkamaiRegionChicago = "us-ord-1" AkamaiRegionFrankfurt = "eu-central-1" AkamaiRegionJakarta = "id-cgk-1" AkamaiRegionLosAngeles = "us-lax-1" AkamaiRegionMiami = "us-mia-1" AkamaiRegionMilan = "it-mil-1" AkamaiRegionNewark = "us-east-1" AkamaiRegionOsaka = "jp-osa-1" AkamaiRegionParis = "fr-par-1" AkamaiRegionSaoPaulo = "br-gru-1" AkamaiRegionSeattle = "us-sea-1" AkamaiRegionSingapore = "ap-south-1" AkamaiRegionStockholm = "se-sto-1" AkamaiRegionAshburn = "us-iad-1" )
const ( AwsACLPrivate = "private" AwsACLPublicRead = "public-read" AwsACLPublicReadWrite = "public-read-write" AwsACLAuthenticatedRead = "authenticated-read" AwsACLAwsExecRead = "aws-exec-read" AwsACLBucketOwnerRead = "bucket-owner-read" AwsACLBucketOwnerFullControl = "bucket-owner-full-control" )
const ( AwsClassStandard = "STANDARD" AwsClassReducedRedundancy = "REDUCED_REDUNDANCY" AwsClassGlacierIR = "GLACIER_IR" AwsClassSnow = "SNOW" AwsClassStandardIA = "STANDARD_IA" AwsClassOneZoneIA = "ONEZONE_IA" AwsClassIntelligentTiering = "INTELLIGENT_TIERING" AwsClassGlacier = "GLACIER" AwsClassDeepArchive = "DEEP_ARCHIVE" )
const ( InvalidAWSACL = "invalid aws acl" ErrorAWSProfileAndKeys = "both aws profile and keys are specified, use profile or keys" ErrorAWSKeyOrSecretNotSpecified = "profile should specified both key and secret" )
const ( ErrorOCICompartmentNotSpecified = "oracle cloud compartment will be tenancy root" ErrorOCIAuthNotSpecified = "oracle cloud auth not specified" ErrorOCIStorageNotSpecified = "oracle cloud storage tier is not valid" )
const ( OracleStorageTierStandard = "standard" OracleStorageTierInfrequentAccess = "infrequentaccess" // the case is strange because of the OracleStorageTierArchive = "archive" )
const ( InvalidNamingMethod = "invalid object naming method" InvalidStorageClass = "invalid storage class" InvalidOverwriteMethod = "invalid overwrite method" InvalidTagChars = "invalid characters removed from tag" ErrorProfilePath = "error determining profile path" ErrorOpeningProfile = "error opening profile" ErrorReadingYaml = "error reading yaml" ErrorLoggingFilepathNotSpecified = "path to log file not specified" ErrorLoggingFilepath = "error determining log file path" ErrorLoggingLevelTooHigh = "logging level too high, setting to 5" ErrorLoggingLevelTooLow = "logging level too low, setting to 0" ErrorGettingFileInfo = "error getting file info" ErrorFileIsDirectory = "listed file is a directory" ErrorNoFilesSpecified = "no files, folders, directories specified" ErrorNoReadableFiles = "no readable files or directories specified" ErrorUnsupportedProfileVersion = "profile version not supported" ErrorProviderNotSpecified = "provider not specified" ErrorBucketNotSpecified = "bucket or region not specified" )
const (
Empty = ""
)
const (
ErrorAkamaiKeyOrSecretNotSpecified = "akamai access keys not specified"
)
const (
OciDefaultProfile = "DEFAULT"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConfig ¶
type AppConfig struct { Provider *Provider Bucket *Bucket Objects *Objects Opts *Opts Tags map[string]string Tag *TagOpts LogOpts *LogOpts Log *logbot.LogBot Files []string Directories []string }
AppConfig is an application level struct that all profile configuration details are loaded into. Log is an instance zerolog.Logger, which is built in logbot. The Files and Directories structs are the list of files and directories to upload.
func NewAppConfig ¶
NewAppConfig will build a new AppConfig object out of the specified yaml file. It creates a readConfig object and called the loadProfile() method to open, read, and unmarshal the yaml file. There is also a validateVersion() method that will eventually be fleshed out to make sure difference profile versions are unmarshalled correctly.
type Bucket ¶
Bucket contains all details related to the bucket, for any provider. Create is not implemented.
type Naming ¶
type Naming string
Naming type is a string enum of the supported object naming methods.
type Objects ¶
type Objects struct { NamePrefix string RootPrefix string Naming Naming // OmitRootDir is used to remove the root directory name from the object's final FormattedKey. OmitRootDir bool }
Objects contain the object naming configuration.
type Overwrite ¶
type Overwrite string
Overwrite type is a string enum of the supported overwrite methods. OverwriteChecksum is not implemented. Overwrite.String() will return the string representation of the enum for convenience, either in output or logging.
type Provider ¶
type Provider struct { Is ProviderName AWS *ProviderAWS OCI *ProviderOCI Akamai *ProviderAkamai Key string Secret string }
Provider represents the configuration for a provider.
Fields: - Is (ProviderName): The name of the provider. (e.g., "AWS", "OCI") - AWS (*ProviderAWS): The configuration for AWS. - OCI (*ProviderOCI): The configuration for OCI. - Key (string): The provider key. - Secret (string): The provider secret.
Usage examples can be found in the surrounding code.
type ProviderAWS ¶
type ProviderAWS struct { Profile string ACL types.ObjectCannedACL Storage types.StorageClass Key string Secret string }
ProviderAWS represents the AWS provider configuration.
Fields: - Profile: The profile name used for authentication. - ACL: The access control list for the storage objects. - Storage: The storage class for the objects. - Key: The AWS access key ID. - Secret: The AWS secret access key.
type ProviderAkamai ¶
ProviderAkamai represents the Linode/Akamai provider configuration
type ProviderName ¶
type ProviderName string
ProviderName type is a string enum of the supported providers, meant to make it easier to check AppConfig.Provider.Is when figuring out which provider config fields should be used. ProviderName.String() will return the string representation of the enum for convenience, either in output or logging.
const ( ProviderNameNone ProviderName = "none" ProviderNameAWS ProviderName = "aws" ProviderNameOCI ProviderName = "oci" ProviderNameAkamai ProviderName = "akamai" )
func (ProviderName) String ¶
func (p ProviderName) String() string
type ProviderOCI ¶
type ProviderOCI struct { Profile string Compartment string Storage objectstorage.StorageTierEnum // this is ridiculous, but the OCI SDK has a separate enum for PUT requests. PutStorage objectstorage.PutObjectStorageTierEnum }
ProviderOCI represents the OCI provider configuration.
type TagOpts ¶
type TagOpts struct { ChecksumSHA256 bool AwsChecksumAlgorithm types.ChecksumAlgorithm AwsChecksumMode types.ChecksumMode Origins bool }
TagOpts contain the object tagging configuration, but only the ones handled internally by the application. Custom tags are put in a separate map named "Tags" inside the AppConfig struct.