oci

package
v0.0.0-...-e90010f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Uploader
	ImageCreator
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientParams *ClientParams) (Client, error)

NewClient creates a new oci client from the passed in params. Pass nil clientParams if you want the client to automatically detect the configuration from the official disk location or and env file From the docs its: $HOME/.oci/config, $HOME/.obmcs/config and variable names starting with TF_VAR. Last is the environment variable OCI_CONFIG_FILE

func (Client) CreateImage

func (c Client) CreateImage(objectName, bucketName, namespace, compartmentID, imageName string) (string, error)

Creates an image from an existing storage object, deletes the storage object

func (Client) PreAuthenticatedRequest

func (c Client) PreAuthenticatedRequest(objectName, bucketName, namespace string) (string, error)

https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/usingpreauthenticatedrequests.htm

func (Client) Upload

func (c Client) Upload(objectName, bucketName, namespace string, file *os.File) error

Upload uploads a file into an objectName under the bucketName in the namespace.

type ClientParams

type ClientParams struct {
	User        string `toml:"user"`
	Region      string `toml:"region"`
	Tenancy     string `toml:"tenancy"`
	PrivateKey  string `toml:"private_key"`
	Fingerprint string `toml:"fingerprint"`
}

type ImageCreator

type ImageCreator interface {
	// contains filtered or unexported methods
}

type Uploader

type Uploader interface {
	Upload(name string, bucketName string, namespace string, file *os.File) error
	CreateImage(name, bucketName, namespace, user, compartment string) (string, error)
	PreAuthenticatedRequest(objectName, bucketName, namespace string) (string, error)
}

Jump to

Keyboard shortcuts

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