Documentation ¶
Index ¶
- Constants
- func Alias(b string) string
- func Bool(v bool) *bool
- func Guard(b string) string
- func GuardArray(b []string) (guardArray []string)
- func HmacSha1(message string, secret string) string
- func Pre(x interface{}, y ...interface{})
- func String(v string) *string
- func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)
- type API
- type APIValidationError
- type Action
- type AppInfo
- type Backend
- type Configuration
- type Context
- type Group
- type LibraryInfo
- type Logger
- type MessageResponse
- type Policy
- type Request
- type Resource
- type ResponseDecoder
- type Role
- type Rule
- type User
Constants ¶
View Source
const ( APIVersion = "v1" Version = "v3" )
View Source
const DefaultBatchSize = 250
View Source
const DefaultEndpoint = "https://papi.permify.co"
View Source
const DefaultInterval = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GuardArray ¶
func Pre ¶
func Pre(x interface{}, y ...interface{})
Pre exit running project. @param interface{} @param ...interface{}
func StructToMap ¶
Types ¶
type APIValidationError ¶
type APIValidationError struct {
Errors map[string]interface{} `json:"errors"`
}
func (APIValidationError) Error ¶
func (e APIValidationError) Error() string
type Action ¶
type Action struct { Alias string `json:"alias"` WorkspaceID string `json:"workspace_id"` CreatedAt time.Time `json:"created_at"` }
Action */
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 Group ¶
type Group struct { ID string `json:"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 Policy ¶
type Policy struct { Name string `json:"name"` GuardName string `json:"guard_name"` Description string `json:"description"` Color string `json:"color"` AnyOf bool `json:"any_of"` Rules []Rule `json:"rules"` Action *Action `json:"action"` WorkspaceID string `json:"workspace_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Policy */
type Resource ¶
type Resource struct { ID string `json:"id"` Type string `json:"type"` Attributes map[string]interface{} `json:"attributes"` WorkspaceID string `json:"workspace_id"` Group *Group `json:"group"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Resource */
type ResponseDecoder ¶
type Role ¶
type Role struct { Name string `json:"name"` GuardName string `json:"guard_name"` Description string `json:"description"` Color string `json:"color"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Role */
type Rule ¶
type Rule struct { Name string `json:"name"` GuardName string `json:"guard_name"` Description string `json:"description"` FailMessage string `json:"fail_message"` Condition string `json:"condition"` WorkspaceID string `json:"workspace_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Rule */
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Photo string `json:"photo"` Attributes map[string]interface{} `json:"attributes"` WorkspaceID string `json:"workspace_id"` Roles []Role `json:"roles"` Groups []Group `json:"groups"` 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.