// FileBySlug makes a GET request to return the Ponzu File Metadata API
// response for the enpoint: `/api/uploads?slug=<Slug>`
FileBySlug makes a GET request to return the Ponzu File Metadata API
response for the enpoint: `/api/uploads?slug=`
// FileBySlug makes a GET request to return the Ponzu File Metadata API // response for the enpoint : ` / api / uploads?slug = <Slug > `
func (c *Client) FileBySlug(slug string) (*APIResponse, error) {
	endpoint := fmt.Sprintf(
		"%s/api/uploads?slug=%s",
		c.Conf.Host, slug,
	)
	if c.CacheEnabled() {
		ok, resp := c.Cache.Check(endpoint)
		if ok {
			return resp, nil
		}
	}
	w, err := c.Get(endpoint)
	if err != nil {
		return nil, err
	}
	resp := &APIResponse{
		Response: w,
	}
	err = resp.process()
	if err != nil {
		return resp, err
	}
	if c.CacheEnabled() {
		err := c.Cache.Add(endpoint, resp)
		return resp, err
	}
	return resp, err
}
func ( c * Client ) FileBySlug ( slug string ) ( * APIResponse , error ) { endpoint := fmt . Sprintf ( " " , c . Conf . Host , slug , ) if c . CacheEnabled ( ) { ok , resp := c . Cache . Check ( endpoint ) if ok { return resp , nil } } w , err := c . Get ( endpoint ) if err != nil { return nil , err } resp := & APIResponse { Response : w , } err = resp . process ( ) if err != nil { return resp , err } if c . CacheEnabled ( ) { err := c . Cache . Add ( endpoint , resp ) return resp , err } return resp , err }
FileBySlug makes a GET request to return the Ponzu File Metadata API
response for the enpoint: `/api/uploads?slug=`
FileBySlug makes a GET request to return the Ponzu File Metadata API response for the enpoint : ` / api / uploads?slug = `