_id stringlengths 2 7 | title stringclasses 1
value | partition stringclasses 3
values | text stringlengths 6 2.61k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
c16200 | train | // this is only used for testing. | {
"resource": ""
} | ||
c16201 | train | //Can only drop table on database which name has "test" suffix.
//Used for testing | {
"resource": ""
} | ||
c16202 | train | // 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... | {
"resource": ""
} | ||
c16203 | train | // Get a Migration instance should get closed like Qbs instance. | {
"resource": ""
} | ||
c16204 | train | // A safe and easy way to work with Migration instance without the need to open and close it. | {
"resource": ""
} | ||
c16205 | train | //Register a database, should be call at the beginning of the application. | {
"resource": ""
} | ||
c16206 | train | //Set the connection limit, there is no limit by default.
//If blocking is true, GetQbs method will be blocked, otherwise returns ConnectionLimitError. | {
"resource": ""
} | ||
c16207 | train | // 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. | {
"resource": ""
} | ||
c16208 | train | // Commit commits a started transaction and will report the first error that
// occurred inside the transaction. | {
"resource": ""
} | ||
c16209 | train | // Rollback rolls back a started transaction. | {
"resource": ""
} | ||
c16210 | train | //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 | {
"resource": ""
} | ||
c16211 | train | // Camel case field names | {
"resource": ""
} | ||
c16212 | train | // 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,... | {
"resource": ""
} | ||
c16213 | train | // Similar to Find, except that FindAll accept pointer of slice of struct pointer,
// rows will be appended to the slice. | {
"resource": ""
} | ||
c16214 | train | // Same as sql.Db.Exec or sql.Tx.Exec depends on if transaction has began | {
"resource": ""
} | ||
c16215 | train | // Same as sql.Db.QueryRow or sql.Tx.QueryRow depends on if transaction has began | {
"resource": ""
} | ||
c16216 | train | // Same as sql.Db.Query or sql.Tx.Query depends on if transaction has began | {
"resource": ""
} | ||
c16217 | train | // Same as sql.Db.Prepare or sql.Tx.Prepare depends on if transaction has began | {
"resource": ""
} | ||
c16218 | train | // 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... | {
"resource": ""
} | ||
c16219 | train | // 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... | {
"resource": ""
} | ||
c16220 | train | // 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 | {
"resource": ""
} | ||
c16221 | train | // 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 | {
"resource": ""
} | ||
c16222 | train | // If the connection pool is not full, the Db will be sent back into the pool, otherwise the Db will get closed. | {
"resource": ""
} | ||
c16223 | train | //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. | {
"resource": ""
} | ||
c16224 | train | //Query raw sql and return a map. | {
"resource": ""
} | ||
c16225 | train | //Query raw sql and return a slice of map.. | {
"resource": ""
} | ||
c16226 | train | //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. | {
"resource": ""
} | ||
c16227 | train | //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. | {
"resource": ""
} | ||
c16228 | train | //Used for in condition. | {
"resource": ""
} | ||
c16229 | train | // New creates new EventSource instance. | {
"resource": ""
} | ||
c16230 | train | // ExampleAll generates example executable file to demo all spinners | {
"resource": ""
} | ||
c16231 | train | // New creates a new wow instance ready to start spinning. | {
"resource": ""
} | ||
c16232 | train | // Start starts the spinner. The frames are written based on the spinner
// interval. | {
"resource": ""
} | ||
c16233 | train | // Stop stops the spinner | {
"resource": ""
} | ||
c16234 | train | // Spinner sets s to the current spinner | {
"resource": ""
} | ||
c16235 | train | // Text adds text to the current spinner | {
"resource": ""
} | ||
c16236 | train | // 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. | {
"resource": ""
} | ||
c16237 | train | // PersistWith writes the last frame of s together with text with a new line
// added to make it stick. | {
"resource": ""
} | ||
c16238 | train | // MpIms returns a slice of mpim object from `mpim.list` api. | {
"resource": ""
} | ||
c16239 | train | // FindMpIm returns a mpim object that satisfy conditions specified. | {
"resource": ""
} | ||
c16240 | train | // Groups returns a slice of group object from `groups.list` api. | {
"resource": ""
} | ||
c16241 | train | // FindGroup returns a group object that satisfy conditions specified. | {
"resource": ""
} | ||
c16242 | train | // FindGroupByName returns a group object that matches name specified. | {
"resource": ""
} | ||
c16243 | train | // FindUser returns a user object that satisfy conditions specified. | {
"resource": ""
} | ||
c16244 | train | // FindUserByName returns a user object that matches name specified. | {
"resource": ""
} | ||
c16245 | train | // Channels returns a slice of channel object from a response of `channels.list` api. | {
"resource": ""
} | ||
c16246 | train | // FindChannel returns a channel object that satisfy conditions specified. | {
"resource": ""
} | ||
c16247 | train | // FindChannelByName returns a channel object that matches name specified. | {
"resource": ""
} | ||
c16248 | train | // Ims returns a slice of im object from `im.list` api. | {
"resource": ""
} | ||
c16249 | train | // FindIm returns a im object that satisfy conditions specified. | {
"resource": ""
} | ||
c16250 | train | // FindImByName returns a im object that matches name specified. | {
"resource": ""
} | ||
c16251 | train | // Add computes addition mod 2^n+1. | {
"resource": ""
} | ||
c16252 | train | // Sub computes substraction mod 2^n+1. | {
"resource": ""
} | ||
c16253 | train | // polyFromNat slices the number x into a polynomial
// with 1<<k coefficients made of m words. | {
"resource": ""
} | ||
c16254 | train | // Int evaluates back a poly to its integer value. | {
"resource": ""
} | ||
c16255 | train | // Mul multiplies p and q modulo X^K-1, where K = 1<<p.k.
// The product is done via a Fourier transform. | {
"resource": ""
} | ||
c16256 | train | // InvTransform reconstructs a polynomial from its values at
// roots of x^K+1. The m field of the returned polynomial
// is unspecified. | {
"resource": ""
} | ||
c16257 | train | // fourier performs an unnormalized Fourier transform
// of src, a length 1<<k vector of numbers modulo b^n+1
// where b = 1<<_W. | {
"resource": ""
} | ||
c16258 | train | // Mul returns the pointwise product of p and q. | {
"resource": ""
} | ||
c16259 | train | // Reset resets the rate limit for the name in the given rate limit period. | {
"resource": ""
} | ||
c16260 | train | // ResetRate resets the rate limit for the name and limit. | {
"resource": ""
} | ||
c16261 | train | // 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. | {
"resource": ""
} | ||
c16262 | train | // AllowRate reports whether an event may happen at time now.
// It allows up to rateLimit events each second. | {
"resource": ""
} | ||
c16263 | train | // StashOldBinary moves the existing ipfs binary to a backup directory
// and returns the path to the original location of the old binary | {
"resource": ""
} | ||
c16264 | train | // Nonexported functions
// Check if library version is greater than or equal to the given one | {
"resource": ""
} | ||
c16265 | train | // Get the API level | {
"resource": ""
} | ||
c16266 | train | // Set the API level | {
"resource": ""
} | ||
c16267 | train | // Get a raw filter attribute | {
"resource": ""
} | ||
c16268 | train | // Set a raw filter attribute | {
"resource": ""
} | ||
c16269 | train | // DOES NOT LOCK OR CHECK VALIDITY
// Assumes caller has already done this
// Wrapper for seccomp_rule_add_... functions | {
"resource": ""
} | ||
c16270 | train | // Generic add function for filter rules | {
"resource": ""
} | ||
c16271 | train | // Generic Helpers
// Helper - Sanitize Arch token input | {
"resource": ""
} | ||
c16272 | train | // Only use with sanitized ops, no error handling | {
"resource": ""
} | ||
c16273 | train | // Only use with sanitized actions, no error handling | {
"resource": ""
} | ||
c16274 | train | // Internal only, assumes safe attribute | {
"resource": ""
} | ||
c16275 | train | // Helpers for types
// GetArchFromString returns an ScmpArch constant from a string representing an
// architecture | {
"resource": ""
} | ||
c16276 | train | // String returns a string representation of an architecture constant | {
"resource": ""
} | ||
c16277 | train | // String returns a string representation of a comparison operator constant | {
"resource": ""
} | ||
c16278 | train | // String returns a string representation of a seccomp match action | {
"resource": ""
} | ||
c16279 | train | // 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. | {
"resource": ""
} | ||
c16280 | train | // 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. | {
"resource": ""
} | ||
c16281 | train | // 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. | {
"resource": ""
} | ||
c16282 | train | // 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. | {
"resource": ""
} | ||
c16283 | train | // Utility Functions
// GetNativeArch returns architecture token representing the native kernel
// architecture | {
"resource": ""
} | ||
c16284 | train | // 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. | {
"resource": ""
} | ||
c16285 | train | // 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. | {
"resource": ""
} | ||
c16286 | train | // 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. | {
"resource": ""
} | ||
c16287 | train | // Load loads a filter context into the kernel.
// Returns an error if the filter context is invalid or the syscall failed. | {
"resource": ""
} | ||
c16288 | train | // 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. | {
"resource": ""
} | ||
c16289 | train | // 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. | {
"resource": ""
} | ||
c16290 | train | // 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... | {
"resource": ""
} | ||
c16291 | train | // 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. | {
"resource": ""
} | ||
c16292 | train | // 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. | {
"resource": ""
} | ||
c16293 | train | // 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. | {
"resource": ""
} | ||
c16294 | train | // 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. | {
"resource": ""
} | ||
c16295 | train | // 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 ... | {
"resource": ""
} | ||
c16296 | train | // 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. | {
"resource": ""
} | ||
c16297 | train | // 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... | {
"resource": ""
} | ||
c16298 | train | // DecorateWithBasicAuth enforces basic auth as a middleware with given credentials | {
"resource": ""
} | ||
c16299 | train | // proxyRequest handles the actual resolution of and then request to the function service. | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.