INNER CODE UNIT · Go
entry
alibaba/sentinel-golang · api/api.go:149
func entry(resource string, options *EntryOptions) (*base.SentinelEntry, *base.BlockError) {
rw := base.NewResourceWrapper(resource, options.resourceType, options.entryType)
sc := options.slotChain
if sc == nil {
return base.NewSentinelEntry(nil, rw, nil), nil
}
// Get context from pool.
ctx := sc.GetPooledContext()
ctx.Resource = rw
ctx.Input.BatchCount = options.batchCount
ctx.Input.Flag = options.flag
if len(options.args) != 0 {
ctx.Input.Args = options.args
}
if len(options.attachments) != 0 {
ctx.Input.Attachments = options.attachments
}