Skip to content

Commit

Permalink
feature/expand transport iface
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Zvonov committed Nov 26, 2024
1 parent 9c52165 commit fb35887
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ func (t *TransportMock) Events() []*Event {
defer t.mu.Unlock()
return t.events
}
func (t *TransportMock) Close() {}

5 changes: 5 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Transport interface {
Flush(timeout time.Duration) bool
Configure(options ClientOptions)
SendEvent(event *Event)
Close()
}

func getProxyConfig(options ClientOptions) func(*http.Request) (*url.URL, error) {
Expand Down Expand Up @@ -672,6 +673,8 @@ func (t *HTTPSyncTransport) SendEvent(event *Event) {
t.SendEventWithContext(context.Background(), event)
}

func (t *HTTPSyncTransport) Close() {}

// SendEventWithContext assembles a new packet out of Event and sends it to the remote server.
func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Event) {
if t.dsn == nil {
Expand Down Expand Up @@ -767,3 +770,5 @@ func (noopTransport) SendEvent(*Event) {
func (noopTransport) Flush(time.Duration) bool {
return true
}

func (noopTransport) Close() {}

0 comments on commit fb35887

Please sign in to comment.