_id stringlengths 2 7 | text stringlengths 6 2.61k | title stringclasses 1
value |
|---|---|---|
c16200 | // this is only used for testing. | |
c16201 | //Can only drop table on database which name has "test" suffix.
//Used for testing | |
c16202 | // CreateIndex creates the specified index on table.
// Some databases like mysql do not support this feature directly,
// So dialect may need to query the database schema table to find out if an index exists.
// Normally you don't need to do it explicitly, it will be created automatically in CreateTableIfNotExists met... | |
c16203 | // Get a Migration instance should get closed like Qbs instance. | |
c16204 | // A safe and easy way to work with Migration instance without the need to open and close it. | |
c16205 | //Register a database, should be call at the beginning of the application. | |
c16206 | //Set the connection limit, there is no limit by default.
//If blocking is true, GetQbs method will be blocked, otherwise returns ConnectionLimitError. | |
c16207 | // Begin create a transaction object internally
// You can perform queries with the same Qbs object
// no matter it is in transaction or not.
// It panics if it's already in a transaction. | |
c16208 | // Commit commits a started transaction and will report the first error that
// occurred inside the transaction. | |
c16209 | // Rollback rolls back a started transaction. | |
c16210 | //Condition defines the SQL "WHERE" clause
//If other condition can be inferred by the struct argument in
//Find method, it will be merged with AND | |
c16211 | // Camel case field names | |
c16212 | // Perform select query by parsing the struct's type and then fill the values into the struct
// All fields of supported types in the struct will be added in select clause.
// If Id value is provided, it will be added into the where clause
// If a foreign key field with its referenced struct pointer field are provided,... | |
c16213 | // Similar to Find, except that FindAll accept pointer of slice of struct pointer,
// rows will be appended to the slice. | |
c16214 | // Same as sql.Db.Exec or sql.Tx.Exec depends on if transaction has began | |
c16215 | // Same as sql.Db.QueryRow or sql.Tx.QueryRow depends on if transaction has began | |
c16216 | // Same as sql.Db.Query or sql.Tx.Query depends on if transaction has began | |
c16217 | // Same as sql.Db.Prepare or sql.Tx.Prepare depends on if transaction has began | |
c16218 | // If Id value is not provided, save will insert the record, and the Id value will
// be filled in the struct after insertion.
// If Id value is provided, save will do a query count first to see if the row exists, if not then insert it,
// otherwise update it.
// If struct implements Validator interface, it will be val... | |
c16219 | // If the struct type implements Validator interface, values will be validated before update.
// In order to avoid inadvertently update the struct field to zero value, it is better to define a
// temporary struct in function, only define the fields that should be updated.
// But the temporary struct can not implement V... | |
c16220 | // The delete condition can be inferred by the Id value of the struct
// If neither Id value or condition are provided, it would cause runtime panic | |
c16221 | // This method can be used to validate unique column before trying to save
// The table parameter can be either a string or a struct pointer | |
c16222 | // If the connection pool is not full, the Db will be sent back into the pool, otherwise the Db will get closed. | |
c16223 | //Query the count of rows in a table the talbe parameter can be either a string or struct pointer.
//If condition is given, the count will be the count of rows meet that condition. | |
c16224 | //Query raw sql and return a map. | |
c16225 | //Query raw sql and return a slice of map.. | |
c16226 | //Do a raw sql query and set the result values in dest parameter.
//The dest parameter can be either a struct pointer or a pointer of struct pointer.slice
//This method do not support pointer field in the struct. | |
c16227 | //Iterate the rows, the first parameter is a struct pointer, the second parameter is a fucntion
//which will get called on each row, the in `do` function the structPtr's value will be set to the current row's value..
//if `do` function returns an error, the iteration will be stopped. | |
c16228 | //Used for in condition. | |
c16229 | // New creates new EventSource instance. | |
c16230 | // ExampleAll generates example executable file to demo all spinners | |
c16231 | // New creates a new wow instance ready to start spinning. | |
c16232 | // Start starts the spinner. The frames are written based on the spinner
// interval. | |
c16233 | // Stop stops the spinner | |
c16234 | // Spinner sets s to the current spinner | |
c16235 | // Text adds text to the current spinner | |
c16236 | // Persist writes the last character of the currect spinner frames together with
// the text on stdout.
//
// A new line is added at the end to ensure the text stay that way. | |
c16237 | // PersistWith writes the last frame of s together with text with a new line
// added to make it stick. | |
c16238 | // MpIms returns a slice of mpim object from `mpim.list` api. | |
c16239 | // FindMpIm returns a mpim object that satisfy conditions specified. | |
c16240 | // Groups returns a slice of group object from `groups.list` api. | |
c16241 | // FindGroup returns a group object that satisfy conditions specified. | |
c16242 | // FindGroupByName returns a group object that matches name specified. | |
c16243 | // FindUser returns a user object that satisfy conditions specified. | |
c16244 | // FindUserByName returns a user object that matches name specified. | |
c16245 | // Channels returns a slice of channel object from a response of `channels.list` api. | |
c16246 | // FindChannel returns a channel object that satisfy conditions specified. | |
c16247 | // FindChannelByName returns a channel object that matches name specified. | |
c16248 | // Ims returns a slice of im object from `im.list` api. | |
c16249 | // FindIm returns a im object that satisfy conditions specified. | |
c16250 | // FindImByName returns a im object that matches name specified. | |
c16251 | // Add computes addition mod 2^n+1. | |
c16252 | // Sub computes substraction mod 2^n+1. | |
c16253 | // polyFromNat slices the number x into a polynomial
// with 1<<k coefficients made of m words. | |
c16254 | // Int evaluates back a poly to its integer value. | |
c16255 | // Mul multiplies p and q modulo X^K-1, where K = 1<<p.k.
// The product is done via a Fourier transform. | |
c16256 | // InvTransform reconstructs a polynomial from its values at
// roots of x^K+1. The m field of the returned polynomial
// is unspecified. | |
c16257 | // fourier performs an unnormalized Fourier transform
// of src, a length 1<<k vector of numbers modulo b^n+1
// where b = 1<<_W. | |
c16258 | // Mul returns the pointwise product of p and q. | |
c16259 | // Reset resets the rate limit for the name in the given rate limit period. | |
c16260 | // ResetRate resets the rate limit for the name and limit. | |
c16261 | // AllowN reports whether an event with given name may happen at time now.
// It allows up to maxn events within period, with each interaction
// incrementing the limit by n. | |
c16262 | // AllowRate reports whether an event may happen at time now.
// It allows up to rateLimit events each second. | |
c16263 | // StashOldBinary moves the existing ipfs binary to a backup directory
// and returns the path to the original location of the old binary | |
c16264 | // Nonexported functions
// Check if library version is greater than or equal to the given one | |
c16265 | // Get the API level | |
c16266 | // Set the API level | |
c16267 | // Get a raw filter attribute | |
c16268 | // Set a raw filter attribute | |
c16269 | // DOES NOT LOCK OR CHECK VALIDITY
// Assumes caller has already done this
// Wrapper for seccomp_rule_add_... functions | |
c16270 | // Generic add function for filter rules | |
c16271 | // Generic Helpers
// Helper - Sanitize Arch token input | |
c16272 | // Only use with sanitized ops, no error handling | |
c16273 | // Only use with sanitized actions, no error handling | |
c16274 | // Internal only, assumes safe attribute | |
c16275 | // Helpers for types
// GetArchFromString returns an ScmpArch constant from a string representing an
// architecture | |
c16276 | // String returns a string representation of an architecture constant | |
c16277 | // String returns a string representation of a comparison operator constant | |
c16278 | // String returns a string representation of a seccomp match action | |
c16279 | // SetReturnCode adds a return code to a supporting ScmpAction, clearing any
// existing code Only valid on ActErrno and ActTrace. Takes no action otherwise.
// Accepts 16-bit return code as argument.
// Returns a valid ScmpAction of the original type with the new error code set. | |
c16280 | // GetNameByArch retrieves the name of a syscall from its number for a given
// architecture.
// Acts on any syscall number.
// Accepts a valid architecture constant.
// Returns either a string containing the name of the syscall, or an error.
// if the syscall is unrecognized or an issue occurred. | |
c16281 | // GetSyscallFromName returns the number of a syscall by name on the kernel's
// native architecture.
// Accepts a string containing the name of a syscall.
// Returns the number of the syscall, or an error if no syscall with that name
// was found. | |
c16282 | // GetSyscallFromNameByArch returns the number of a syscall by name for a given
// architecture's ABI.
// Accepts the name of a syscall and an architecture constant.
// Returns the number of the syscall, or an error if an invalid architecture is
// passed or a syscall with that name was not found. | |
c16283 | // Utility Functions
// GetNativeArch returns architecture token representing the native kernel
// architecture | |
c16284 | // NewFilter creates and returns a new filter context.
// Accepts a default action to be taken for syscalls which match no rules in
// the filter.
// Returns a reference to a valid filter context, or nil and an error if the
// filter context could not be created or an invalid default action was given. | |
c16285 | // Reset resets a filter context, removing all its existing state.
// Accepts a new default action to be taken for syscalls which do not match.
// Returns an error if the filter or action provided are invalid. | |
c16286 | // AddArch adds an architecture to the filter.
// Accepts an architecture constant.
// Returns an error on invalid filter context or architecture token, or an
// issue with the call to libseccomp. | |
c16287 | // Load loads a filter context into the kernel.
// Returns an error if the filter context is invalid or the syscall failed. | |
c16288 | // GetDefaultAction returns the default action taken on a syscall which does not
// match a rule in the filter, or an error if an issue was encountered
// retrieving the value. | |
c16289 | // GetBadArchAction returns the default action taken on a syscall for an
// architecture not in the filter, or an error if an issue was encountered
// retrieving the value. | |
c16290 | // GetLogBit returns the current state the Log bit will be set to on the filter
// being loaded, or an error if an issue was encountered retrieving the value.
// The Log bit tells the kernel that all actions taken by the filter, with the
// exception of ActAllow, should be logged.
// The Log bit is only usable when lib... | |
c16291 | // SetBadArchAction sets the default action taken on a syscall for an
// architecture not in the filter, or an error if an issue was encountered
// setting the value. | |
c16292 | // SetNoNewPrivsBit sets the state of the No New Privileges bit, which will be
// applied on filter load, or an error if an issue was encountered setting the
// value.
// Filters with No New Privileges set to 0 can only be loaded if the process
// has the CAP_SYS_ADMIN capability. | |
c16293 | // SetLogBit sets the state of the Log bit, which will be applied on filter
// load, or an error if an issue was encountered setting the value.
// The Log bit is only usable when libseccomp API level 3 or higher is
// supported. | |
c16294 | // AddRule adds a single rule for an unconditional action on a syscall.
// Accepts the number of the syscall and the action to be taken on the call
// being made.
// Returns an error if an issue was encountered adding the rule. | |
c16295 | // AddRuleConditional adds a single rule for a conditional action on a syscall.
// Returns an error if an issue was encountered adding the rule.
// All conditions must match for the rule to match.
// There is a bug in library versions below v2.2.1 which can, in some cases,
// cause conditions to be lost when more than ... | |
c16296 | // check uses the client ip address, the challenge code from the reCaptcha form,
// and the client's response input to that challenge to determine whether or not
// the client answered the reCaptcha input question correctly.
// It returns a boolean value indicating whether or not the client answered correctly. | |
c16297 | // Confirm is the public interface function.
// It calls check, which the client ip address, the challenge code from the reCaptcha form,
// and the client's response input to that challenge to determine whether or not
// the client answered the reCaptcha input question correctly.
// It returns a boolean value indicatin... | |
c16298 | // DecorateWithBasicAuth enforces basic auth as a middleware with given credentials | |
c16299 | // proxyRequest handles the actual resolution of and then request to the function service. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.