Documentation
¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func Guard(b string) string
- func GuardArray(b []string) (guardArray []string)
- func HmacSha1(message string, secret string) string
- func String(v string) *string
- type API
- type APIValidationError
- type AppInfo
- type Backend
- type Configuration
- type Context
- type Counter
- type Group
- type LibraryInfo
- type Logger
- type MessageResponse
- type Permission
- type Request
- type ResponseDecoder
- type Role
- type Scheduler
- type Session
- type Trigger
- type User
Constants ¶
View Source
const DefaultBatchSize = 250
View Source
const DefaultEndpoint = "https://api.permify.co"
View Source
const DefaultInterval = 5 * time.Second
View Source
const Version = "v1"
Variables ¶
This section is empty.
Functions ¶
func GuardArray ¶
Types ¶
type APIValidationError ¶
type APIValidationError struct {
Errors map[string]interface{} `json:"errors"`
}
func (APIValidationError) Error ¶
func (e APIValidationError) Error() string
type Backend ¶
type Backend struct {
Configuration
// contains filtered or unexported fields
}
func GetBackend ¶
func GetBackendWithConfiguration ¶
func GetBackendWithConfiguration(workspaceID, privateKey string, configuration Configuration) (client *Backend, err error)
type Configuration ¶
type Context ¶
type Context struct {
App AppInfo `json:"app,omitempty"`
Library LibraryInfo `json:"library,omitempty"`
Locale string `json:"locale,omitempty"`
Timezone string `json:"timezone,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
}
type Counter ¶
type Counter struct {
ID string `json:"id"`
UserID string `json:"user_id"`
User *User `json:"user"`
PermissionID string `json:"permission_id"`
Permission *Permission `json:"permission"`
WorkspaceID string `json:"workspace_id"`
Value int64 `json:"value"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Group ¶
type Group struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
Name string `json:"name"`
WorkspaceID string `json:"workspace_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Group */
type LibraryInfo ¶
type Logger ¶
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
func (MessageResponse) Error ¶
func (e MessageResponse) Error() string
type Permission ¶
type Permission struct {
ID string `json:"id"`
Name string `json:"name"`
GuardName string `json:"guard_name"`
Description string `json:"description"`
Color string `json:"color"`
WorkspaceID string `json:"workspace_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Permission */
type ResponseDecoder ¶
type Role ¶
type Role struct {
ID string `json:"id"`
Name string `json:"name"`
GuardName string `json:"guard_name"`
Description string `json:"description"`
Color string `json:"color"`
GroupID string `json:"group_id"`
Permissions []Permission `json:"permissions"`
Users []User `json:"users"`
TotalPermissionCount uint `json:"total_permission_count"`
TotalUserCount uint `json:"total_user_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Role */
type Scheduler ¶
type Scheduler struct {
ID string `json:"id"`
Name string `json:"name"`
UserID string `json:"user_id"`
User *User `json:"user"`
WorkspaceID string `json:"workspace_id"`
Roles []Role `json:"roles"`
Permissions []Permission `json:"permissions"`
Triggers []Trigger `json:"triggers"`
CreatedAt time.Time `json:"created_at"`
}
type Session ¶
type Session struct {
ID string `json:"id"`
Token string `json:"token"`
WorkspaceID string `json:"workspace_id"`
GroupID string `json:"group_id"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
Session */
type User ¶
type User struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
Name string `json:"name"`
Photo *string `json:"photo"`
Title *string `json:"title"`
WorkspaceID string `json:"workspace_id"`
Roles []Role `json:"roles"`
Permissions []Permission `json:"permissions"`
GroupID string `json:"group_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
User */
Source Files
¶
Click to show internal directories.
Click to hide internal directories.