func (c *FindClient) Find(ctx context.Context, query string, options ...FindOption) ([]transport.FindResponse, error) {
	opts := newFindOptions()
	for _, option := range options {
		option(opts)
	}

	c.logger.Tracef("Find(%s)", query)
	path, err := c.path.Query("q", query)
	if err != nil {
		return nil, errors.Trace(err)
	}

	path, err = path.Query("fields", defaultFindFilter())
	if err != nil {
		return nil, errors.Trace(err)
	}

	if err := walkFindOptions(opts, func(name, value string) error {
		path, err = path.Query(name, value)
		return errors.Trace(err)
	}); err != nil {
		return nil, errors.Trace(err)
	}

	var resp transport.FindResponses
	restResp, err := c.client.Get(ctx, path, &resp)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if restResp.StatusCode == http.StatusNotFound {
		return nil, errors.NotFoundf(query)
	}
	if err := handleBasicAPIErrors(resp.ErrorList, c.logger); err != nil {
		return nil, errors.Trace(err)
	}

	return resp.Results, nil
}
// Find searches Charm Hub and provides results matching a string.
Find searches Charm Hub and provides results matching a string.
// Find searches Charm Hub and provides results matching a string .
func (c *FindClient) Find(ctx context.Context, query string, options ...FindOption) ([]transport.FindResponse, error) {
	opts := newFindOptions()
	for _, option := range options {
		option(opts)
	}
	c.logger.Tracef("Find(%s)", query)
	path, err := c.path.Query("q", query)
	if err != nil {
		return nil, errors.Trace(err)
	}
	path, err = path.Query("fields", defaultFindFilter())
	if err != nil {
		return nil, errors.Trace(err)
	}
	if err := walkFindOptions(opts, func(name, value string) error {
		path, err = path.Query(name, value)
		return errors.Trace(err)
	}); err != nil {
		return nil, errors.Trace(err)
	}
	var resp transport.FindResponses
	restResp, err := c.client.Get(ctx, path, &resp)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if restResp.StatusCode == http.StatusNotFound {
		return nil, errors.NotFoundf(query)
	}
	if err := handleBasicAPIErrors(resp.ErrorList, c.logger); err != nil {
		return nil, errors.Trace(err)
	}
	return resp.Results, nil
}
func ( c * FindClient ) Find ( ctx context . Context , query string , options ... FindOption ) ( [ ] transport . FindResponse , error ) { opts := newFindOptions ( ) for _ , option := range options { option ( opts ) } c . logger . Tracef ( " " , query ) path , err := c . path . Query ( " " , query ) if err != nil { return nil , errors . Trace ( err ) } path , err = path . Query ( " " , defaultFindFilter ( ) ) if err != nil { return nil , errors . Trace ( err ) } if err := walkFindOptions ( opts , func ( name , value string ) error { path , err = path . Query ( name , value ) return errors . Trace ( err ) } ) ; err != nil { return nil , errors . Trace ( err ) } var resp transport . FindResponses restResp , err := c . client . Get ( ctx , path , & resp ) if err != nil { return nil , errors . Trace ( err ) } if restResp . StatusCode == http . StatusNotFound { return nil , errors . NotFoundf ( query ) } if err := handleBasicAPIErrors ( resp . ErrorList , c . logger ) ; err != nil { return nil , errors . Trace ( err ) } return resp . Results , nil }
Find searches Charm Hub and provides results matching a string.
Find searches Charm Hub and provides results matching a string .