Versions in this module Expand all Collapse all v0 v0.18.2 Jun 9, 2023 Changes in this version + const CurrentUserURLPath + const EnvMetabaseBaseURL + const EnvMetabasePassword + const EnvMetabaseSessionID + const EnvMetabaseTLSSkipVerify + const EnvMetabaseUsername + const HeaderMetabaseSession + const RelPathAPIDatabase + const RelPathAPISession + const RelPathAPIUserCurrent + var TLSInsecureSkipVerify = false + func AuthRequest(authURL, username, password string, tlsSkipVerify bool) (*http.Response, error) + func BuildURL(server, urlpath string) string + func NewClientEnv(opts *ConfigEnvOpts) (*http.Client, *AuthResponse, *Config, error) + func NewClientSessionID(sessionID string, allowInsecure bool) *http.Client + func RetrieveQuestions(cu ClientUtil, q2s QuestionsToSlug, dir string) (map[string][]byte, error) + type AuthResponse struct + ID string + func NewClient(cfg Config) (*http.Client, *AuthResponse, error) + func NewClientPassword(baseURL, username, password string, allowInsecure bool) (*http.Client, *AuthResponse, error) + func NewClientPasswordWithSessionID(baseURL, username, password, sessionID string, allowInsecure bool) (*http.Client, *AuthResponse, error) + type ClientUtil struct + BaseURL string + HTTPClient *http.Client + func NewClientUtil(baseURL, username, password string, tlsSkipVerify bool) (*ClientUtil, error) + func (cu *ClientUtil) BuildMetabaseCardAPI(cardID int, format string) string + func (cu *ClientUtil) GetCurrentUser() (User, *http.Response, error) + func (cu *ClientUtil) GetQuestionData(cardID int) ([]byte, error) + func (cu *ClientUtil) GetSCIMUser() (scim.User, error) + func (cu *ClientUtil) GetStoreQuestionData(cardID int, filename string, perm os.FileMode) ([]byte, error) + type Config struct + BaseURL string + Password string + SessionID string + TLSSkipVerify bool + Username string + func (cfg *Config) NewClient() (*http.Client, *AuthResponse, error) + func (cfg *Config) Validate() error + type ConfigEnvOpts struct + EnvMetabaseBaseURL string + EnvMetabasePassword string + EnvMetabaseSessionID string + EnvMetabaseTLSSkipVerify string + EnvMetabaseUsername string + EnvPaths []string + EnvPathsLoad bool + func (opts *ConfigEnvOpts) Config() Config + func (opts *ConfigEnvOpts) Defaultify() + func (opts *ConfigEnvOpts) LoadEnv() error + type QuestionsToSlug struct + QuestionMap map[string]int + type User struct + CommonName string + DateJoined time.Time + Email string + FirstName string + GoogleAuth bool + ID int + IsActive bool + IsQbnewb bool + IsSuperuser bool + LastLogin time.Time + LastName string + LdapAuth bool