Documentation ¶
Index ¶
- func AddApplication(application *Application) (bool, error)
- func AddOrganization(organization *Organization) (bool, error)
- func AddUser(user *User) (bool, error)
- func CheckUserPassword(user *User) (bool, error)
- func DeleteApplication(name string) (bool, error)
- func DeleteOrganization(name string) (bool, error)
- func DeleteResource(name string) (bool, error)
- func DeleteUser(user *User) (bool, error)
- func DoGetBytes(url string) ([]byte, error)
- func DoGetBytesRaw(url string) ([]byte, error)
- func GetMyProfileUrl(accessToken string) string
- func GetOAuthToken(code string, state string) (*oauth2.Token, error)
- func GetSigninUrl(redirectUri string) string
- func GetSignupUrl(enablePassword bool, redirectUri string) string
- func GetUrl(action string, queryMap map[string]string) string
- func GetUserCount(isOnline string) (int, error)
- func GetUserProfileUrl(userName string, accessToken string) string
- func InitConfig(endpoint string, clientId string, clientSecret string, certificate string, ...)
- func RefreshOAuthToken(refreshToken string) (*oauth2.Token, error)
- func SendEmail(title string, content string, sender string, receivers ...string) error
- func SendSms(content string, receivers ...string) error
- func UpdateUser(user *User) (bool, error)
- func UpdateUserForColumns(user *User, columns []string) (bool, error)
- func UploadResource(user string, tag string, parent string, fullFilePath string, fileBytes []byte) (string, string, error)
- func UploadResourceEx(user string, tag string, parent string, fullFilePath string, fileBytes []byte, ...) (string, string, error)
- type Application
- type AuthConfig
- type Claims
- type Organization
- type Permission
- type Resource
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddApplication ¶
func AddApplication(application *Application) (bool, error)
func AddOrganization ¶
func AddOrganization(organization *Organization) (bool, error)
func CheckUserPassword ¶
func DeleteApplication ¶
func DeleteOrganization ¶
func DeleteResource ¶
func DeleteUser ¶
func DoGetBytes ¶
DoGetBytes is a general function to get response from param url through HTTP Get method.
func DoGetBytesRaw ¶
DoGetBytesRaw is a general function to get response from param url through HTTP Get method.
func GetMyProfileUrl ¶
func GetOAuthToken ¶
GetOAuthToken gets the pivotal and necessary secret to interact with the Casdoor server
func GetSigninUrl ¶
func GetSignupUrl ¶
func GetUserCount ¶
func GetUserProfileUrl ¶
func InitConfig ¶
func RefreshOAuthToken ¶
RefreshOAuthToken refreshes the OAuth token
func UpdateUser ¶
func UploadResource ¶
Types ¶
type Application ¶
type Application struct { Owner string `json:"owner"` Name string `json:"name"` CreatedTime string `json:"createdTime"` DisplayName string `json:"displayName"` Logo string `json:"logo"` HomepageUrl string `json:"homepageUrl"` Description string `json:"description"` Organization string `json:"organization"` Cert string `json:"cert"` EnablePassword bool `json:"enablePassword"` EnableSignUp bool `json:"enableSignUp"` EnableSigninSession bool `json:"enableSigninSession"` EnableCodeSignin bool `json:"enableCodeSignin"` ClientId string `json:"clientId"` ClientSecret string `json:"clientSecret"` RedirectUris []string `json:"redirectUris"` TokenFormat string `json:"tokenFormat"` ExpireInHours int `json:"expireInHours"` RefreshExpireInHours int `json:"refreshExpireInHours"` SignupUrl string `json:"signupUrl"` SigninUrl string `json:"signinUrl"` ForgetUrl string `json:"forgetUrl"` AffiliationUrl string `json:"affiliationUrl"` TermsOfUse string `json:"termsOfUse"` SignupHtml string `json:"signupHtml"` SigninHtml string `json:"signinHtml"` }
Application has the same definition as https://github.com/casdoor/casdoor/blob/master/object/application.go#L24
type AuthConfig ¶
type AuthConfig struct { Endpoint string ClientId string ClientSecret string Certificate string OrganizationName string ApplicationName string }
AuthConfig is the core configuration. The first step to use this SDK is to use the InitConfig function to initialize the global authConfig.
type Claims ¶
func ParseJwtToken ¶
type Organization ¶
type Organization struct { Owner string `json:"owner"` Name string `json:"name"` CreatedTime string `json:"createdTime"` DisplayName string `json:"displayName"` WebsiteUrl string `json:"websiteUrl"` Favicon string `json:"favicon"` PasswordType string `json:"passwordType"` PasswordSalt string `json:"passwordSalt"` PhonePrefix string `json:"phonePrefix"` DefaultAvatar string `json:"defaultAvatar"` MasterPassword string `json:"masterPassword"` EnableSoftDeletion bool `json:"enableSoftDeletion"` }
Organization has the same definition as https://github.com/casdoor/casdoor/blob/master/object/organization.go#L25
type Permission ¶
type Permission struct { Action string `json:"action"` Actions []string `json:"actions"` CreatedTime string `json:"createdTime"` DisplayName string `json:"displayName"` Effect string `json:"effect"` IsEnabled bool `json:"isEnabled"` Name string `json:"name"` Owner string `json:"owner"` ResourceType string `json:"resourceType"` Resources []string `json:"resources"` Roles []string `json:"roles"` Users []string `json:"users"` }
func GetPermission ¶
func GetPermission() ([]*Permission, error)
type Resource ¶
Resource has the same definition as https://github.com/casdoor/casdoor/blob/master/object/resource.go#L24
type Response ¶
type Response struct { Status string `json:"status"` Msg string `json:"msg"` Data interface{} `json:"data"` Data2 interface{} `json:"data2"` }
func AddPermission ¶
func AddPermission(q Permission) (*Response, error)
type User ¶
type User struct { Owner string `json:"owner"` Name string `json:"name"` CreatedTime string `json:"createdTime"` UpdatedTime string `json:"updatedTime"` Id string `json:"id"` Type string `json:"type"` Password string `json:"password"` PasswordSalt string `json:"passwordSalt"` DisplayName string `json:"displayName"` Avatar string `json:"avatar"` PermanentAvatar string `json:"permanentAvatar"` Email string `json:"email"` Phone string `json:"phone"` Location string `json:"location"` Address []string `json:"address"` Affiliation string `json:"affiliation"` Title string `json:"title"` IdCardType string `json:"idCardType"` IdCard string `json:"idCard"` Homepage string `json:"homepage"` Bio string `json:"bio"` Tag string `json:"tag"` Region string `json:"region"` Language string `json:"language"` Gender string `json:"gender"` Birthday string `json:"birthday"` Education string `json:"education"` Score int `json:"score"` Karma int `json:"karma"` Ranking int `json:"ranking"` IsDefaultAvatar bool `json:"isDefaultAvatar"` IsOnline bool `json:"isOnline"` IsAdmin bool `json:"isAdmin"` IsGlobalAdmin bool `json:"isGlobalAdmin"` IsForbidden bool `json:"isForbidden"` IsDeleted bool `json:"isDeleted"` SignupApplication string `json:"signupApplication"` Hash string `json:"hash"` PreHash string `json:"preHash"` CreatedIp string `json:"createdIp"` LastSigninTime string `json:"lastSigninTime"` LastSigninIp string `json:"lastSigninIp"` Github string `json:"github"` Google string `json:"google"` QQ string `json:"qq"` WeChat string `json:"wechat"` Facebook string `json:"facebook"` DingTalk string `json:"dingtalk"` Weibo string `json:"weibo"` Gitee string `json:"gitee"` LinkedIn string `json:"linkedin"` Wecom string `json:"wecom"` Lark string `json:"lark"` Gitlab string `json:"gitlab"` Ldap string `json:"ldap"` Properties map[string]string `json:"properties"` }
User has the same definition as https://github.com/casdoor/casdoor/blob/master/object/user.go#L24