Documentation ¶
Index ¶
- func NewAdapter(endpoint string, cred *azidentity.DefaultAzureCredential, options Options) persist.Adapter
- func NewAdapterFromClient(client *azcosmos.Client, options Options) persist.Adapter
- func NewAdapterFromConnectionSting(connectionString string, options Options) persist.Adapter
- type CasbinRule
- type Data
- type Options
- type P
- type QueryParam
- type SqlQuerySpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
func NewAdapter(endpoint string, cred *azidentity.DefaultAzureCredential, options Options) persist.Adapter
NewAdapter is the constructor for Adapter. if no options are given the database name is "casbin" and the containerClient is named casbin_rule if the database or containerClient is not found it is automatically created. the database can be changed by using the Database(db string) option. the containerClient can be changed by using the Collection(coll string) option. see README for example
func NewAdapterFromClient ¶
Types ¶
type CasbinRule ¶
type CasbinRule struct { ID string `json:"id"` PType string `json:"pType"` V0 string `json:"v0"` V1 string `json:"v1"` V2 string `json:"v2"` V3 string `json:"v3"` V4 string `json:"v4"` V5 string `json:"v5"` }
CasbinRule represents a rule in Casbin.
type Data ¶
type Data struct { Documents interface{} `json:"Documents,omitempty"` Count int `json:"_count,omitempty"` }
type Options ¶
type Options struct { azcosmos.ClientOptions DatabaseName string ContainerName string }
type P ¶
type P = QueryParam
type QueryParam ¶
type QueryParam struct { Name string `json:"name"` Value interface{} `json:"value"` }
type SqlQuerySpec ¶
type SqlQuerySpec struct { Query string `json:"query"` Parameters []azcosmos.QueryParameter `json:"parameters,omitempty"` }
func Q ¶
func Q(query string, queryParams ...azcosmos.QueryParameter) *SqlQuerySpec
Click to show internal directories.
Click to hide internal directories.