assetstorage

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package assetstorage provides a client for the "assetstorage" canister. Do NOT edit this file. It was automatically generated by https://github.com/aviate-labs/agent-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	*agent.Agent
	CanisterId principal.Principal
}

Agent is a client for the "assetstorage" canister.

func NewAgent

func NewAgent(canisterId principal.Principal, config agent.Config) (*Agent, error)

NewAgent creates a new agent for the "assetstorage" canister.

func (Agent) ApiVersion

func (a Agent) ApiVersion() (*uint16, error)

ApiVersion calls the "api_version" method on the "assetstorage" canister.

func (Agent) Authorize

func (a Agent) Authorize(arg0 principal.Principal) error

Authorize calls the "authorize" method on the "assetstorage" canister.

func (Agent) CertifiedTree

func (a Agent) CertifiedTree(arg0 struct {
}) (*struct {
	Certificate []byte `ic:"certificate" json:"certificate"`
	Tree        []byte `ic:"tree" json:"tree"`
}, error)

CertifiedTree calls the "certified_tree" method on the "assetstorage" canister.

func (Agent) Clear

func (a Agent) Clear(arg0 ClearArguments) error

Clear calls the "clear" method on the "assetstorage" canister.

func (Agent) CommitBatch

func (a Agent) CommitBatch(arg0 CommitBatchArguments) error

CommitBatch calls the "commit_batch" method on the "assetstorage" canister.

func (Agent) CommitProposedBatch

func (a Agent) CommitProposedBatch(arg0 CommitProposedBatchArguments) error

CommitProposedBatch calls the "commit_proposed_batch" method on the "assetstorage" canister.

func (Agent) ComputeEvidence

func (a Agent) ComputeEvidence(arg0 ComputeEvidenceArguments) (**[]byte, error)

ComputeEvidence calls the "compute_evidence" method on the "assetstorage" canister.

func (Agent) Configure added in v0.3.4

func (a Agent) Configure(arg0 ConfigureArguments) error

Configure calls the "configure" method on the "assetstorage" canister.

func (Agent) CreateAsset

func (a Agent) CreateAsset(arg0 CreateAssetArguments) error

CreateAsset calls the "create_asset" method on the "assetstorage" canister.

func (Agent) CreateBatch

func (a Agent) CreateBatch(arg0 struct {
}) (*struct {
	BatchId BatchId `ic:"batch_id" json:"batch_id"`
}, error)

CreateBatch calls the "create_batch" method on the "assetstorage" canister.

func (Agent) CreateChunk

func (a Agent) CreateChunk(arg0 struct {
	BatchId BatchId `ic:"batch_id" json:"batch_id"`
	Content []byte  `ic:"content" json:"content"`
}) (*struct {
	ChunkId ChunkId `ic:"chunk_id" json:"chunk_id"`
}, error)

CreateChunk calls the "create_chunk" method on the "assetstorage" canister.

func (Agent) Deauthorize

func (a Agent) Deauthorize(arg0 principal.Principal) error

Deauthorize calls the "deauthorize" method on the "assetstorage" canister.

func (Agent) DeleteAsset

func (a Agent) DeleteAsset(arg0 DeleteAssetArguments) error

DeleteAsset calls the "delete_asset" method on the "assetstorage" canister.

func (Agent) DeleteBatch

func (a Agent) DeleteBatch(arg0 DeleteBatchArguments) error

DeleteBatch calls the "delete_batch" method on the "assetstorage" canister.

func (Agent) Get

func (a Agent) Get(arg0 struct {
	Key             Key      `ic:"key" json:"key"`
	AcceptEncodings []string `ic:"accept_encodings" json:"accept_encodings"`
}) (*struct {
	Content         []byte  `ic:"content" json:"content"`
	ContentType     string  `ic:"content_type" json:"content_type"`
	ContentEncoding string  `ic:"content_encoding" json:"content_encoding"`
	Sha256          *[]byte `ic:"sha256,omitempty" json:"sha256,omitempty"`
	TotalLength     idl.Nat `ic:"total_length" json:"total_length"`
}, error)

Get calls the "get" method on the "assetstorage" canister.

func (Agent) GetAssetProperties

func (a Agent) GetAssetProperties(key Key) (*struct {
	MaxAge         *uint64        `ic:"max_age,omitempty" json:"max_age,omitempty"`
	Headers        *[]HeaderField `ic:"headers,omitempty" json:"headers,omitempty"`
	AllowRawAccess *bool          `ic:"allow_raw_access,omitempty" json:"allow_raw_access,omitempty"`
	IsAliased      *bool          `ic:"is_aliased,omitempty" json:"is_aliased,omitempty"`
}, error)

GetAssetProperties calls the "get_asset_properties" method on the "assetstorage" canister.

func (Agent) GetChunk

func (a Agent) GetChunk(arg0 struct {
	Key             Key     `ic:"key" json:"key"`
	ContentEncoding string  `ic:"content_encoding" json:"content_encoding"`
	Index           idl.Nat `ic:"index" json:"index"`
	Sha256          *[]byte `ic:"sha256,omitempty" json:"sha256,omitempty"`
}) (*struct {
	Content []byte `ic:"content" json:"content"`
}, error)

GetChunk calls the "get_chunk" method on the "assetstorage" canister.

func (Agent) GetConfiguration added in v0.3.4

func (a Agent) GetConfiguration() (*ConfigurationResponse, error)

GetConfiguration calls the "get_configuration" method on the "assetstorage" canister.

func (Agent) GrantPermission

func (a Agent) GrantPermission(arg0 GrantPermission) error

GrantPermission calls the "grant_permission" method on the "assetstorage" canister.

func (Agent) HttpRequest

func (a Agent) HttpRequest(request HttpRequest) (*HttpResponse, error)

HttpRequest calls the "http_request" method on the "assetstorage" canister.

func (Agent) HttpRequestStreamingCallback

func (a Agent) HttpRequestStreamingCallback(token StreamingCallbackToken) (**StreamingCallbackHttpResponse, error)

HttpRequestStreamingCallback calls the "http_request_streaming_callback" method on the "assetstorage" canister.

func (Agent) List

func (a Agent) List(arg0 struct {
}) (*[]struct {
	Key         Key    `ic:"key" json:"key"`
	ContentType string `ic:"content_type" json:"content_type"`
	Encodings   []struct {
		ContentEncoding string  `ic:"content_encoding" json:"content_encoding"`
		Sha256          *[]byte `ic:"sha256,omitempty" json:"sha256,omitempty"`
		Length          idl.Nat `ic:"length" json:"length"`
		Modified        Time    `ic:"modified" json:"modified"`
	} `ic:"encodings" json:"encodings"`
}, error)

List calls the "list" method on the "assetstorage" canister.

func (Agent) ListAuthorized

func (a Agent) ListAuthorized() (*[]principal.Principal, error)

ListAuthorized calls the "list_authorized" method on the "assetstorage" canister.

func (Agent) ListPermitted

func (a Agent) ListPermitted(arg0 ListPermitted) (*[]principal.Principal, error)

ListPermitted calls the "list_permitted" method on the "assetstorage" canister.

func (Agent) ProposeCommitBatch

func (a Agent) ProposeCommitBatch(arg0 CommitBatchArguments) error

ProposeCommitBatch calls the "propose_commit_batch" method on the "assetstorage" canister.

func (Agent) RevokePermission

func (a Agent) RevokePermission(arg0 RevokePermission) error

RevokePermission calls the "revoke_permission" method on the "assetstorage" canister.

func (Agent) SetAssetContent

func (a Agent) SetAssetContent(arg0 SetAssetContentArguments) error

SetAssetContent calls the "set_asset_content" method on the "assetstorage" canister.

func (Agent) SetAssetProperties

func (a Agent) SetAssetProperties(arg0 SetAssetPropertiesArguments) error

SetAssetProperties calls the "set_asset_properties" method on the "assetstorage" canister.

func (Agent) Store

func (a Agent) Store(arg0 struct {
	Key             Key     `ic:"key" json:"key"`
	ContentType     string  `ic:"content_type" json:"content_type"`
	ContentEncoding string  `ic:"content_encoding" json:"content_encoding"`
	Content         []byte  `ic:"content" json:"content"`
	Sha256          *[]byte `ic:"sha256,omitempty" json:"sha256,omitempty"`
}) error

Store calls the "store" method on the "assetstorage" canister.

func (Agent) TakeOwnership

func (a Agent) TakeOwnership() error

TakeOwnership calls the "take_ownership" method on the "assetstorage" canister.

func (Agent) UnsetAssetContent

func (a Agent) UnsetAssetContent(arg0 UnsetAssetContentArguments) error

UnsetAssetContent calls the "unset_asset_content" method on the "assetstorage" canister.

func (Agent) ValidateCommitProposedBatch

func (a Agent) ValidateCommitProposedBatch(arg0 CommitProposedBatchArguments) (*ValidationResult, error)

ValidateCommitProposedBatch calls the "validate_commit_proposed_batch" method on the "assetstorage" canister.

func (Agent) ValidateConfigure added in v0.3.4

func (a Agent) ValidateConfigure(arg0 ConfigureArguments) (*ValidationResult, error)

ValidateConfigure calls the "validate_configure" method on the "assetstorage" canister.

func (Agent) ValidateGrantPermission

func (a Agent) ValidateGrantPermission(arg0 GrantPermission) (*ValidationResult, error)

ValidateGrantPermission calls the "validate_grant_permission" method on the "assetstorage" canister.

func (Agent) ValidateRevokePermission

func (a Agent) ValidateRevokePermission(arg0 RevokePermission) (*ValidationResult, error)

ValidateRevokePermission calls the "validate_revoke_permission" method on the "assetstorage" canister.

func (Agent) ValidateTakeOwnership

func (a Agent) ValidateTakeOwnership() (*ValidationResult, error)

ValidateTakeOwnership calls the "validate_take_ownership" method on the "assetstorage" canister.

type AssetCanisterArgs added in v0.3.4

type AssetCanisterArgs struct {
	Init    *InitArgs    `ic:"Init,variant"`
	Upgrade *UpgradeArgs `ic:"Upgrade,variant"`
}

type BatchId

type BatchId = idl.Nat

type BatchOperationKind

type BatchOperationKind struct {
	CreateAsset        *CreateAssetArguments        `ic:"CreateAsset,variant"`
	SetAssetContent    *SetAssetContentArguments    `ic:"SetAssetContent,variant"`
	SetAssetProperties *SetAssetPropertiesArguments `ic:"SetAssetProperties,variant"`
	UnsetAssetContent  *UnsetAssetContentArguments  `ic:"UnsetAssetContent,variant"`
	DeleteAsset        *DeleteAssetArguments        `ic:"DeleteAsset,variant"`
	Clear              *ClearArguments              `ic:"Clear,variant"`
}

type ChunkId

type ChunkId = idl.Nat

type ClearArguments

type ClearArguments struct {
}

type CommitBatchArguments

type CommitBatchArguments struct {
	BatchId    BatchId              `ic:"batch_id" json:"batch_id"`
	Operations []BatchOperationKind `ic:"operations" json:"operations"`
}

type CommitProposedBatchArguments

type CommitProposedBatchArguments struct {
	BatchId  BatchId `ic:"batch_id" json:"batch_id"`
	Evidence []byte  `ic:"evidence" json:"evidence"`
}

type ComputeEvidenceArguments

type ComputeEvidenceArguments struct {
	BatchId       BatchId `ic:"batch_id" json:"batch_id"`
	MaxIterations *uint16 `ic:"max_iterations,omitempty" json:"max_iterations,omitempty"`
}

type ConfigurationResponse added in v0.3.4

type ConfigurationResponse struct {
	MaxBatches *uint64 `ic:"max_batches,omitempty" json:"max_batches,omitempty"`
	MaxChunks  *uint64 `ic:"max_chunks,omitempty" json:"max_chunks,omitempty"`
	MaxBytes   *uint64 `ic:"max_bytes,omitempty" json:"max_bytes,omitempty"`
}

type ConfigureArguments added in v0.3.4

type ConfigureArguments struct {
	MaxBatches **uint64 `ic:"max_batches,omitempty" json:"max_batches,omitempty"`
	MaxChunks  **uint64 `ic:"max_chunks,omitempty" json:"max_chunks,omitempty"`
	MaxBytes   **uint64 `ic:"max_bytes,omitempty" json:"max_bytes,omitempty"`
}

type CreateAssetArguments

type CreateAssetArguments struct {
	Key            Key            `ic:"key" json:"key"`
	ContentType    string         `ic:"content_type" json:"content_type"`
	MaxAge         *uint64        `ic:"max_age,omitempty" json:"max_age,omitempty"`
	Headers        *[]HeaderField `ic:"headers,omitempty" json:"headers,omitempty"`
	EnableAliasing *bool          `ic:"enable_aliasing,omitempty" json:"enable_aliasing,omitempty"`
	AllowRawAccess *bool          `ic:"allow_raw_access,omitempty" json:"allow_raw_access,omitempty"`
}

type DeleteAssetArguments

type DeleteAssetArguments struct {
	Key Key `ic:"key" json:"key"`
}

type DeleteBatchArguments

type DeleteBatchArguments struct {
	BatchId BatchId `ic:"batch_id" json:"batch_id"`
}

type GrantPermission

type GrantPermission struct {
	ToPrincipal principal.Principal `ic:"to_principal" json:"to_principal"`
	Permission  Permission          `ic:"permission" json:"permission"`
}

type HeaderField

type HeaderField struct {
	Field0 string `ic:"0" json:"0"`
	Field1 string `ic:"1" json:"1"`
}

type HttpRequest

type HttpRequest struct {
	Method             string        `ic:"method" json:"method"`
	Url                string        `ic:"url" json:"url"`
	Headers            []HeaderField `ic:"headers" json:"headers"`
	Body               []byte        `ic:"body" json:"body"`
	CertificateVersion *uint16       `ic:"certificate_version,omitempty" json:"certificate_version,omitempty"`
}

type HttpResponse

type HttpResponse struct {
	StatusCode        uint16             `ic:"status_code" json:"status_code"`
	Headers           []HeaderField      `ic:"headers" json:"headers"`
	Body              []byte             `ic:"body" json:"body"`
	StreamingStrategy *StreamingStrategy `ic:"streaming_strategy,omitempty" json:"streaming_strategy,omitempty"`
}

type InitArgs added in v0.3.4

type InitArgs struct {
}

type Key

type Key = string

type ListPermitted

type ListPermitted struct {
	Permission Permission `ic:"permission" json:"permission"`
}

type Permission

type Permission struct {
	Commit            *idl.Null `ic:"Commit,variant"`
	ManagePermissions *idl.Null `ic:"ManagePermissions,variant"`
	Prepare           *idl.Null `ic:"Prepare,variant"`
}

type RevokePermission

type RevokePermission struct {
	OfPrincipal principal.Principal `ic:"of_principal" json:"of_principal"`
	Permission  Permission          `ic:"permission" json:"permission"`
}

type SetAssetContentArguments

type SetAssetContentArguments struct {
	Key             Key       `ic:"key" json:"key"`
	ContentEncoding string    `ic:"content_encoding" json:"content_encoding"`
	ChunkIds        []ChunkId `ic:"chunk_ids" json:"chunk_ids"`
	Sha256          *[]byte   `ic:"sha256,omitempty" json:"sha256,omitempty"`
}

type SetAssetPropertiesArguments

type SetAssetPropertiesArguments struct {
	Key            Key             `ic:"key" json:"key"`
	MaxAge         **uint64        `ic:"max_age,omitempty" json:"max_age,omitempty"`
	Headers        **[]HeaderField `ic:"headers,omitempty" json:"headers,omitempty"`
	AllowRawAccess **bool          `ic:"allow_raw_access,omitempty" json:"allow_raw_access,omitempty"`
	IsAliased      **bool          `ic:"is_aliased,omitempty" json:"is_aliased,omitempty"`
}

type SetPermissions added in v0.3.4

type SetPermissions struct {
	Prepare           []principal.Principal `ic:"prepare" json:"prepare"`
	Commit            []principal.Principal `ic:"commit" json:"commit"`
	ManagePermissions []principal.Principal `ic:"manage_permissions" json:"manage_permissions"`
}

type StreamingCallbackHttpResponse

type StreamingCallbackHttpResponse struct {
	Body  []byte                  `ic:"body" json:"body"`
	Token *StreamingCallbackToken `ic:"token,omitempty" json:"token,omitempty"`
}

type StreamingCallbackToken

type StreamingCallbackToken struct {
	Key             Key     `ic:"key" json:"key"`
	ContentEncoding string  `ic:"content_encoding" json:"content_encoding"`
	Index           idl.Nat `ic:"index" json:"index"`
	Sha256          *[]byte `ic:"sha256,omitempty" json:"sha256,omitempty"`
}

type StreamingStrategy

type StreamingStrategy struct {
	Callback *struct {
		Callback struct {
		} `ic:"callback" json:"callback"`
		Token StreamingCallbackToken `ic:"token" json:"token"`
	} `ic:"Callback,variant"`
}

type Time

type Time = idl.Int

type UnsetAssetContentArguments

type UnsetAssetContentArguments struct {
	Key             Key    `ic:"key" json:"key"`
	ContentEncoding string `ic:"content_encoding" json:"content_encoding"`
}

type UpgradeArgs added in v0.3.4

type UpgradeArgs struct {
	SetPermissions *SetPermissions `ic:"set_permissions,omitempty" json:"set_permissions,omitempty"`
}

type ValidationResult

type ValidationResult struct {
	Ok  *string `ic:"Ok,variant"`
	Err *string `ic:"Err,variant"`
}

Jump to

Keyboard shortcuts

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