<commit_before>// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package charmstore

import (
	"io"

	"gopkg.in/juju/charm.v6-unstable"
)

// Client exposes the functionality of a charm store client as needed
// for charm store operations for Juju resources.
type Client interface {
	io.Closer

	// GetResource returns a reader for the resource's data. That data
	// is streamed from the charm store.
	GetResource(cURL *charm.URL, resourceName string, revision int) (io.ReadCloser, error)
}<commit_msg>Split out a BaseClient interface and add a ListResources() method.<commit_after>// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package charmstore

import (
	"io"

	"gopkg.in/juju/charm.v6-unstable"
	charmresource "gopkg.in/juju/charm.v6-unstable/resource"
)

// Client exposes the functionality of a charm store client as needed
// for charm store operations for Juju resources.
type Client interface {
	BaseClient
	io.Closer
}

// BaseClient exposes the functionality of charmrepo/csclient.Client,
// as used for charm store operations for Juju resources.
type BaseClient interface {
	// ListResources composes, for each of the identified charms, the
	// list of details for each of the charm's resources. Those details
	// are those associated with the specific charm revision. They
	// include the resource's metadata and revision.
	ListResources(charmURLs []charm.URL) ([][]charmresource.Resource, error)

	// GetResource returns a reader for the resource's data. That data
	// is streamed from the charm store. The charm's revision, if any,
	// is ignored. If the identified resource is not in the charm store
	// then errors.NotFound is returned.
	GetResource(cURL *charm.URL, resourceName string, revision int) (io.ReadCloser, error)
}
{'fraction_non_alphanumeric': 0.08228882833787465, 'fraction_numerical': 0.007084468664850136, 'mean_word_length': 4.0578512396694215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4985521', 'n_tokens_mistral': 552, 'n_tokens_neox': 521, 'n_words': 220}