Documentation
¶
Index ¶
- Variables
- func BuildHTTPListRequest(endpoint, user, token string, limit, offset int) (*http.Request, error)
- func BuildHTTPRequest(endpoint, user, token, path string, queryParams map[string]string) (*http.Request, error)
- func BuildHTTPShowRequest(endpoint, user, token string, id int) (*http.Request, error)
- func CacheExpired(cachePath string, cacheTTL int) bool
- func DoHTTPRequest(req *http.Request) ([]byte, error)
- func GetCachedCreds(cachePath string) []string
- func ListAction(c *cli.Context) error
- func ReloadAction(c *cli.Context) error
- func ShowAction(c *cli.Context) error
- func StoreCreds(cachePath string, creds []ListResponseCred, lastUpdated time.Time) error
- type ListResponse
- type ListResponseCred
- type ListResponseMeta
- type ShowResponseCred
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BuildHTTPListRequest ¶
BuildHTTPListRequest builds HTTP Request to list Creds
func BuildHTTPRequest ¶
func BuildHTTPRequest(endpoint, user, token, path string, queryParams map[string]string) (*http.Request, error)
BuildHTTPRequest builds HTTP Request
func BuildHTTPShowRequest ¶
BuildHTTPShowRequest builds HTTP Request to list Creds
func CacheExpired ¶
CacheExpired return cache is expired or not
func DoHTTPRequest ¶
DoHTTPRequest do HTTP Request and return response body
func GetCachedCreds ¶
GetCachedCreds return creds from cache
func ReloadAction ¶
ReloadAction do re-auth, update token, discard local cache
func ShowAction ¶
ShowAction do HTTP request to fetch Cred details
func StoreCreds ¶
func StoreCreds(cachePath string, creds []ListResponseCred, lastUpdated time.Time) error
StoreCreds store creds to cache
Types ¶
type ListResponse ¶
type ListResponse struct {
Meta ListResponseMeta `json:"meta"`
Objects []ListResponseCred `json:"objects"`
}
ListResponse HTTP Response
type ListResponseCred ¶
ListResponseCred HTTP Response
func GetCreds ¶
func GetCreds(endpoint, user, token string) []ListResponseCred
GetCreds return ... from RatticWeb
type ListResponseMeta ¶
type ListResponseMeta struct {
Next string `json:"next"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ListResponseMeta HTTP Response
type ShowResponseCred ¶
ShowResponseCred HTTP Response
func GetCred ¶
func GetCred(endpoint, user, token string, id int) ShowResponseCred
GetCred return ... from RatticWeb
Click to show internal directories.
Click to hide internal directories.