// isReadOnly returns whether the given method name is for a read-only method.
181089
func isReadOnly(methodName string) bool {
	return strings.HasPrefix(methodName, "Get") || strings.HasPrefix(methodName, "List")
}
230295
func (n *node) isAllowed(c nodeContent, here bool) bool {
	if n.container.duplicates {
		return true
	}
	checkNode := n
	if here {
		checkNode = n.parent
	}
	for _, child := range checkNode.children {
		if child.content.key() == c.key() {
			return false
		}
	}
	return true
}
809609
func (s *SMBFileShareInfo) SetReadOnly(v bool) *SMBFileShareInfo {
	s.ReadOnly = &v
	return s
}
946494
func WithRootFSReadonly() SpecOpts {
	return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
		setRoot(s)
		s.Root.Readonly = true
		return nil
	}
}
156571
func (s *CreateSMBFileShareInput) SetReadOnly(v bool) *CreateSMBFileShareInput {
	s.ReadOnly = &v
	return s
}
973935
func (agent *ActionAgent) SetReadOnly(ctx context.Context, rdonly bool) error {
	if err := agent.lock(ctx); err != nil {
		return err
	}
	defer agent.unlock()

	return agent.MysqlDaemon.SetReadOnly(rdonly)
}
664889
func (md *RootMetadata) IsReader(
	ctx context.Context, checker kbfsmd.TeamMembershipChecker,
	osg idutil.OfflineStatusGetter, uid keybase1.UID) (bool, error) {
	h := md.GetTlfHandle()
	return isReaderFromHandle(ctx, h, checker, osg, uid)
}
1348774
func isReader(ctx context.Context, teamMemChecker kbfsmd.TeamMembershipChecker,
	currentUID keybase1.UID, mergedMasterHead kbfsmd.RootMetadata,
	extra kbfsmd.ExtraMetadata) (bool, error) {
	h, err := mergedMasterHead.MakeBareTlfHandle(extra)
	if err != nil {
		return false, err
	}

	if h.Type() == tlf.SingleTeam {
		isReader, err := teamMemChecker.IsTeamReader(
			ctx, h.Writers[0].AsTeamOrBust(), currentUID,
			keybase1.OfflineAvailability_NONE)
		if err != nil {
			return false, kbfsmd.ServerError{Err: err}
		}
		return isReader, nil
	}

	return h.IsReader(currentUID.AsUserOrTeam()), nil
}
1028508
func (f *File) hasMethod(typ types.Type, name string) bool {
	// assume we have an addressable variable of type typ
	obj, _, _ := types.LookupFieldOrMethod(typ, true, f.pkg.typesPkg, name)
	_, ok := obj.(*types.Func)
	return ok
}
39163
func (s *server) SetReadOnly(ctx context.Context, request *tabletmanagerdatapb.SetReadOnlyRequest) (response *tabletmanagerdatapb.SetReadOnlyResponse, err error) {
	defer s.agent.HandleRPCPanic(ctx, "SetReadOnly", request, response, true /*verbose*/, &err)
	ctx = callinfo.GRPCCallInfo(ctx)
	response = &tabletmanagerdatapb.SetReadOnlyResponse{}
	return response, s.agent.SetReadOnly(ctx, true)
}
1095808
func IsErrUnknownMethod(err error) bool {
	return err != nil && strings.Contains(err.Error(), errUnknownMethod)
}
752274
func (ch *Chunk) IsFullyRead() bool {
	if ch == nil || ch.R == nil {
		return true
	}
	return ch.Size <= ch.Pos
}
922137
func isHandlerMethod(method reflect.Method) bool {
	mt := method.Type
	// Method must be exported.
	if method.PkgPath != "" {
		return false
	}

	// Method needs two or three ins: receiver, context.Context and optional []byte or pointer.
	if mt.NumIn() != 2 && mt.NumIn() != 3 {
		return false
	}

	if t1 := mt.In(1); !t1.Implements(typeOfContext) {
		return false
	}

	if mt.NumIn() == 3 && mt.In(2).Kind() != reflect.Ptr && mt.In(2) != typeOfBytes {
		return false
	}

	// Method needs either no out or two outs: interface{}(or []byte), error
	if mt.NumOut() != 0 && mt.NumOut() != 2 {
		return false
	}

	if mt.NumOut() == 2 && (mt.Out(1) != typeOfError || mt.Out(0) != typeOfBytes && mt.Out(0).Kind() != reflect.Ptr) {
		return false
	}

	return true
}
590323
func (mysqld *Mysqld) SetReadOnly(on bool) error {
	query := "SET GLOBAL read_only = "
	if on {
		query += "ON"
	} else {
		query += "OFF"
	}
	return mysqld.ExecuteSuperQuery(context.TODO(), query)
}
212054
func IsCancelled(err error) bool {
	_, ok := getImplementer(err).(ErrCancelled)
	return ok
}
653072
func (s *NFSFileShareInfo) SetReadOnly(v bool) *NFSFileShareInfo {
	s.ReadOnly = &v
	return s
}
1047682
func OpenDbForReadOnly(opts *Options, name string, errorIfLogFileExist bool) (*DB, error) {
	var (
		cErr  *C.char
		cName = C.CString(name)
	)
	defer C.free(unsafe.Pointer(cName))
	db := C.rocksdb_open_for_read_only(opts.c, cName, boolToChar(errorIfLogFileExist), &cErr)
	if cErr != nil {
		defer C.free(unsafe.Pointer(cErr))
		return nil, errors.New(C.GoString(cErr))
	}
	return &DB{
		name: name,
		c:    db,
		opts: opts,
	}, nil
}