Ubuntu Pastebin

Paste from Nate Finch at Mon, 16 May 2016 21:07:20 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main

import (
	"log"

	"github.com/juju/juju/charmstore"
	"gopkg.in/juju/charm.v6-unstable"
	csparams "gopkg.in/juju/charmrepo.v2-unstable/csclient/params"
	"gopkg.in/macaroon.v1"
)

func main() {
	client, err := charmstore.NewCachingClient(cache{}, nil)
	log.Println(err)
	r := charmstore.ResourceRequest{
		Charm:    charm.MustParseURL("cs:~cmars/mattermost-8"),
		Channel:  csparams.StableChannel,
		Name:     "bdist",
		Revision: 1,
	}
	data, err := client.GetResource(r)
	log.Println(err)
	log.Printf("meta: %#v", data.Resource)
}

type cache struct{}

func (cache) Set(*charm.URL, macaroon.Slice) error   { return nil }
func (cache) Get(*charm.URL) (macaroon.Slice, error) { return nil, nil }
Download as text