// Code generated by counterfeiter. DO NOT EDIT. package authfakes import ( "sync" "time" "github.com/livekit/livekit-server/pkg/auth" ) type FakeTokenIssuer struct { CreateTokenStub func(*auth.GrantClaims, time.Duration) (string, error) createTokenMutex sync.RWMutex createTokenArgsForCall []struct { arg1 *auth.GrantClaims arg2 time.Duration } createTokenReturns struct { result1 string result2 error } createTokenReturnsOnCall map[int]struct { result1 string result2 error } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } func (fake *FakeTokenIssuer) CreateToken(arg1 *auth.GrantClaims, arg2 time.Duration) (string, error) { fake.createTokenMutex.Lock() ret, specificReturn := fake.createTokenReturnsOnCall[len(fake.createTokenArgsForCall)] fake.createTokenArgsForCall = append(fake.createTokenArgsForCall, struct { arg1 *auth.GrantClaims arg2 time.Duration }{arg1, arg2}) stub := fake.CreateTokenStub fakeReturns := fake.createTokenReturns fake.recordInvocation("CreateToken", []interface{}{arg1, arg2}) fake.createTokenMutex.Unlock() if stub != nil { return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } return fakeReturns.result1, fakeReturns.result2 } func (fake *FakeTokenIssuer) CreateTokenCallCount() int { fake.createTokenMutex.RLock() defer fake.createTokenMutex.RUnlock() return len(fake.createTokenArgsForCall) } func (fake *FakeTokenIssuer) CreateTokenCalls(stub func(*auth.GrantClaims, time.Duration) (string, error)) { fake.createTokenMutex.Lock() defer fake.createTokenMutex.Unlock() fake.CreateTokenStub = stub } func (fake *FakeTokenIssuer) CreateTokenArgsForCall(i int) (*auth.GrantClaims, time.Duration) { fake.createTokenMutex.RLock() defer fake.createTokenMutex.RUnlock() argsForCall := fake.createTokenArgsForCall[i] return argsForCall.arg1, argsForCall.arg2 } func (fake *FakeTokenIssuer) CreateTokenReturns(result1 string, result2 error) { fake.createTokenMutex.Lock() defer fake.createTokenMutex.Unlock() fake.CreateTokenStub = nil fake.createTokenReturns = struct { result1 string result2 error }{result1, result2} } func (fake *FakeTokenIssuer) CreateTokenReturnsOnCall(i int, result1 string, result2 error) { fake.createTokenMutex.Lock() defer fake.createTokenMutex.Unlock() fake.CreateTokenStub = nil if fake.createTokenReturnsOnCall == nil { fake.createTokenReturnsOnCall = make(map[int]struct { result1 string result2 error }) } fake.createTokenReturnsOnCall[i] = struct { result1 string result2 error }{result1, result2} } func (fake *FakeTokenIssuer) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.createTokenMutex.RLock() defer fake.createTokenMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } func (fake *FakeTokenIssuer) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } var _ auth.TokenIssuer = new(FakeTokenIssuer)