ActionLogOption class
ActionLogOption
만약, 특정 액션을 설정을 원하지 않는다면, ref 에 null 을 저장하면 된다. 그러면, 해당 액션은 제한 설정을 하지 않는다.
Constructors
-
ActionLogOption({DatabaseReference? ref, int limit = 100, int seconds = 10000, int count = 0, bool debug = false, Future<
bool?> overLimit(ActionLogOption)?})
Properties
- category ↔ String?
-
게시판의 경우, 카테고리를 지정하여, 여러개의 게시판에 대해서 각각의 제한을 설정할 수 있다.
getter/setter pair
- count ↔ int
-
getter/setter pair
- debug ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- limit ↔ int
-
limit 은 몇 개의 액션을 허용할 것인지를 설정한다. 참고로 이 값이 커지면, DB 에서 그 만큼 많은 데이터를 가져와야
하므로, 성능에 영향을 줄 수 있다. 그래서 최대 100 정도로 설정하는 것이 좋다. 보통 10 이내의 값을 주면 된다.
getter/setter pair
- limitCategory ↔ String?
-
limit 에 걸린 경우, 어느 카테고리에 글 쓰려고 할 때, limit 에 걸렸는지 표시한다.
getter/setter pair
- limitRoomId ↔ String?
-
limit 에 걸린 경우, 어느 채팅방에 참여할 때 limit 에 걸렸는지 표시한다.
getter/setter pair
- limitUid ↔ String?
-
limit 에 걸린 경우, 어느 사용자 프로필을 볼 때 limit 에 걸렸는지 표시한다.
getter/setter pair
-
overLimit
↔ (Future<
bool?> Function(ActionLogOption)?) -
getter/setter pair
- query → Query?
-
no setter
- ref ↔ DatabaseReference?
-
주의: limit 걸어서 쿼리를 할 때, query 를 사용해야 한다.
ref 를 사용하면, limit 이 적용되지 않는다. 다만, 개별 데이터가 존재하는지는 ref 를 써서 쿼리를 하면 된다.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seconds ↔ int
-
seconds 는 몇 초 동안 제한을 할 것인지를 설정한다. 만약, 10초 동안 3개의 액션을 허용하고 싶다면,
limit 은 3, seconds 는 10 이 된다.
getter/setter pair
Methods
-
getTimeLeft(
) → Future< int?> - 제한 시간이 지나기까지 몇 초가 남았는지 계산한다.
-
isOverLimit(
{String? uid, String? roomId, String? category}) → Future< bool> - limit 에 걸렸는지 확인을 한다.
-
logTimeLeft(
) → dynamic - 디버깅을 위해서, 남은 시간을 로그로 남긴다.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited