golift.io/starr@v1.0.0/prowlarr/prowlarr.go (about)

     1  package prowlarr
     2  
     3  import (
     4  	"strings"
     5  
     6  	"golift.io/starr"
     7  )
     8  
     9  // Prowlarr contains all the methods to interact with a Prowlarr server.
    10  type Prowlarr struct {
    11  	starr.APIer
    12  }
    13  
    14  // APIver is the Prowlarr API version supported by this library.
    15  const APIver = "v1"
    16  
    17  // New returns a Prowlarr object used to interact with the Prowlarr API.
    18  func New(config *starr.Config) *Prowlarr {
    19  	if config.Client == nil {
    20  		config.Client = starr.Client(0, false)
    21  	}
    22  
    23  	config.URL = strings.TrimSuffix(config.URL, "/")
    24  
    25  	return &Prowlarr{APIer: config}
    26  }