Documentation ¶
Overview ¶
name 'idpclient' is used although it repeats the name of the outer package 'idp' in order to improve readability functions like e.g. idpclient.New() or idpclient.HttpClient()
Package idpclient provides a client for the IdentityProvider-App ¶
An idpclient with sensible defaults can be created as follows:
c,_ := idpclient.New()
If you don't want to use the defaults provide one or more options:
httpClient := &http.Client{ Timeout: 2 * time.Second, } c, _ := idpclient.New(idpclient.HttpClient(httpClient))
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new Client for the IdentityProvider-App using the following defaults:
- HttpClient: http.DefaultClient
- principalCache: An internal implementation is used
If you don't want to use the defaults provide one or more options to this function.
Example (Custom) ¶
package main import ( "net/http" "time" "github.com/d-velop/dvelop-sdk-go/idp/idpclient" ) func main() { // create client with custom http.Client httpClient := &http.Client{ Timeout: 2 * time.Second, } _, _ = idpclient.New(idpclient.HttpClient(httpClient)) }
Output:
Example (Default) ¶
package main import ( "github.com/d-velop/dvelop-sdk-go/idp/idpclient" ) func main() { // create client with defaults _, _ = idpclient.New() }
Output:
Types ¶
type Cache ¶
type Cache interface { // Get an item from the cache. Returns the item or nil, and a bool indicating // whether the key was found. Get(key string) (item interface{}, found bool) // Add an item to the cache, replacing any existing item. // If cacheDuration is <= 0 the item never expires Set(key string, item interface{}, cacheDuration time.Duration) }
Cache is an interface representing the ability to cache arbitrary items for a certain amount of time
Click to show internal directories.
Click to hide internal directories.