* feat(ooapi): add toplevel client and simplify API This diff should simplify using ooapi from other packages by adding more abstraction that wraps the existing code. Part of https://github.com/ooni/probe/issues/1355. * fix(ooapi): use correct comment for cloners See https://github.com/ooni/probe-cli/pull/248#discussion_r590663843 * fix(ooapi): make sure the documentation is current See https://github.com/ooni/probe-cli/pull/248#discussion_r590665773 * fix(ooapi): automate copying APIs See https://github.com/ooni/probe-cli/pull/248#discussion_r590665837 * feat(ooapi): add unit tests for clientcall.go See https://github.com/ooni/probe-cli/pull/248#discussion_r590666297 * fix(ooapi): rewrite integration tests to use toplevel API See https://github.com/ooni/probe-cli/pull/248#discussion_r590665084
		
			
				
	
	
		
			15 lines
		
	
	
		
			511 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			511 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package ooapi
 | 
						|
 | 
						|
import "errors"
 | 
						|
 | 
						|
// Errors defined by this package.
 | 
						|
var (
 | 
						|
	ErrAPICallFailed   = errors.New("ooapi: API call failed")
 | 
						|
	ErrEmptyField      = errors.New("ooapi: empty field")
 | 
						|
	ErrHTTPFailure     = errors.New("ooapi: http request failed")
 | 
						|
	ErrJSONLiteralNull = errors.New("ooapi: server returned us a literal null")
 | 
						|
	ErrMissingToken    = errors.New("ooapi: missing auth token")
 | 
						|
	ErrUnauthorized    = errors.New("ooapi: not authorized")
 | 
						|
	errCacheNotFound   = errors.New("ooapi: not found in cache")
 | 
						|
)
 |