resource

package
v2.0.0-...-822b922 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

The resource package provides your charm access to Juju resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Installer

type Installer func(resourcePath string) error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) GetPath

func (s *Service) GetPath(name string) (string, error)

GetPath returns the local path to the file for a named resource.

func (*Service) Has

func (s *Service) Has(name string) bool

Has returns if given resource is available.

func (*Service) Reg

func (s *Service) Reg(name, description string, installer Installer)

Reg registers the resource name to the resources service. Given name and description are used to register the resource with the hook.Registry, the installers is called when the resource changes on charm deploy or upgrade. Each time the install or upgrade-charm hooks are called a hash is made of the, resource. When the hash for a resource is changed or non-existent the installers is called.

func (*Service) Register

func (s *Service) Register(r *hook.Registry)

Register registers the service with the given registry.

Jump to

Keyboard shortcuts

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