Bringing things to order in workflows/ #363
@@ -1,24 +0,0 @@
 | 
				
			|||||||
name: lint
 | 
					 | 
				
			||||||
on:
 | 
					 | 
				
			||||||
  pull_request:
 | 
					 | 
				
			||||||
    branches:
 | 
					 | 
				
			||||||
    - master
 | 
					 | 
				
			||||||
    - v3
 | 
					 | 
				
			||||||
jobs:
 | 
					 | 
				
			||||||
  lint:
 | 
					 | 
				
			||||||
    name: lint
 | 
					 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					 | 
				
			||||||
    steps:
 | 
					 | 
				
			||||||
    - name: setup-go
 | 
					 | 
				
			||||||
      uses: actions/setup-go@v3
 | 
					 | 
				
			||||||
      with:
 | 
					 | 
				
			||||||
        go-version: 1.21
 | 
					 | 
				
			||||||
    - name: checkout
 | 
					 | 
				
			||||||
      uses: actions/checkout@v3
 | 
					 | 
				
			||||||
    - name: deps
 | 
					 | 
				
			||||||
      run: go get -v -d ./...
 | 
					 | 
				
			||||||
    - name: lint
 | 
					 | 
				
			||||||
      uses: https://github.com/golangci/golangci-lint-action@v3.4.0
 | 
					 | 
				
			||||||
      continue-on-error: true
 | 
					 | 
				
			||||||
      with:
 | 
					 | 
				
			||||||
        version: v1.52
 | 
					 | 
				
			||||||
							
								
								
									
										40
									
								
								.gitea/workflows/pipeline.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								.gitea/workflows/pipeline.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					name: pipeline
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  pull_request:
 | 
				
			||||||
 | 
					    branches:
 | 
				
			||||||
 | 
					    - master
 | 
				
			||||||
 | 
					    - v3
 | 
				
			||||||
 | 
					    - v4
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  lint:
 | 
				
			||||||
 | 
					    name: lint
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: setup-go
 | 
				
			||||||
 | 
					      uses: actions/setup-go@v5
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        go-version: 'stable'
 | 
				
			||||||
 | 
					    - name: checkout
 | 
				
			||||||
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
 | 
					    - name: deps
 | 
				
			||||||
 | 
					      run: go get -v -d ./...
 | 
				
			||||||
 | 
					    - name: lint
 | 
				
			||||||
 | 
					      uses: https://github.com/golangci/golangci-lint-action@v6
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        version: v1.62.2
 | 
				
			||||||
 | 
					  test:
 | 
				
			||||||
 | 
					    name: test
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: setup-go
 | 
				
			||||||
 | 
					      uses: actions/setup-go@v5
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        go-version: 'stable'
 | 
				
			||||||
 | 
					    - name: checkout
 | 
				
			||||||
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
 | 
					    - name: deps
 | 
				
			||||||
 | 
					      run: go get -v -d ./...
 | 
				
			||||||
 | 
					    - name: test
 | 
				
			||||||
 | 
					      env:
 | 
				
			||||||
 | 
					        INTEGRATION_TESTS: yes
 | 
				
			||||||
 | 
					      run: go test -mod readonly -v ./...
 | 
				
			||||||
@@ -1,23 +0,0 @@
 | 
				
			|||||||
name: pr
 | 
					 | 
				
			||||||
on:
 | 
					 | 
				
			||||||
  pull_request:
 | 
					 | 
				
			||||||
    branches:
 | 
					 | 
				
			||||||
    - master
 | 
					 | 
				
			||||||
    - v3
 | 
					 | 
				
			||||||
jobs:
 | 
					 | 
				
			||||||
  test:
 | 
					 | 
				
			||||||
    name: test
 | 
					 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					 | 
				
			||||||
    steps:
 | 
					 | 
				
			||||||
    - name: checkout
 | 
					 | 
				
			||||||
      uses: actions/checkout@v3
 | 
					 | 
				
			||||||
    - name: setup-go
 | 
					 | 
				
			||||||
      uses: actions/setup-go@v3
 | 
					 | 
				
			||||||
      with:
 | 
					 | 
				
			||||||
        go-version: 1.21
 | 
					 | 
				
			||||||
    - name: deps
 | 
					 | 
				
			||||||
      run: go get -v -t -d ./...
 | 
					 | 
				
			||||||
    - name: test
 | 
					 | 
				
			||||||
      env:
 | 
					 | 
				
			||||||
        INTEGRATION_TESTS: yes
 | 
					 | 
				
			||||||
      run: go test -mod readonly -v ./...
 | 
					 | 
				
			||||||
@@ -1,44 +1,5 @@
 | 
				
			|||||||
run:
 | 
					run:
 | 
				
			||||||
  concurrency: 4
 | 
					  concurrency: 8
 | 
				
			||||||
  deadline: 5m
 | 
					  deadline: 5m
 | 
				
			||||||
  issues-exit-code: 1
 | 
					  issues-exit-code: 1
 | 
				
			||||||
  tests: true
 | 
					  tests: true
 | 
				
			||||||
 | 
					 | 
				
			||||||
linters-settings:
 | 
					 | 
				
			||||||
  govet:
 | 
					 | 
				
			||||||
    check-shadowing: true
 | 
					 | 
				
			||||||
    enable:
 | 
					 | 
				
			||||||
      - fieldalignment
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
linters:
 | 
					 | 
				
			||||||
  enable:
 | 
					 | 
				
			||||||
    - govet
 | 
					 | 
				
			||||||
    - deadcode
 | 
					 | 
				
			||||||
    - errcheck
 | 
					 | 
				
			||||||
    - govet
 | 
					 | 
				
			||||||
    - ineffassign
 | 
					 | 
				
			||||||
    - staticcheck
 | 
					 | 
				
			||||||
    - structcheck
 | 
					 | 
				
			||||||
    - typecheck
 | 
					 | 
				
			||||||
    - unused
 | 
					 | 
				
			||||||
    - varcheck
 | 
					 | 
				
			||||||
    - bodyclose
 | 
					 | 
				
			||||||
    - gci
 | 
					 | 
				
			||||||
    - goconst
 | 
					 | 
				
			||||||
    - gocritic
 | 
					 | 
				
			||||||
    - gosimple
 | 
					 | 
				
			||||||
    - gofmt
 | 
					 | 
				
			||||||
    - gofumpt
 | 
					 | 
				
			||||||
    - goimports
 | 
					 | 
				
			||||||
    - revive
 | 
					 | 
				
			||||||
    - gosec
 | 
					 | 
				
			||||||
    - makezero
 | 
					 | 
				
			||||||
    - misspell
 | 
					 | 
				
			||||||
    - nakedret
 | 
					 | 
				
			||||||
    - nestif
 | 
					 | 
				
			||||||
    - nilerr
 | 
					 | 
				
			||||||
    - noctx
 | 
					 | 
				
			||||||
    - prealloc
 | 
					 | 
				
			||||||
    - unconvert
 | 
					 | 
				
			||||||
    - unparam
 | 
					 | 
				
			||||||
  disable-all: false
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,14 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type EventType int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const (
 | 
				
			||||||
 | 
						EventTypeUnknown = iota
 | 
				
			||||||
 | 
						EventTypeConnect
 | 
				
			||||||
 | 
						EventTypeDisconnect
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	ErrWatcherStopped = errors.New("watcher stopped")
 | 
						ErrWatcherStopped = errors.New("watcher stopped")
 | 
				
			||||||
	// ErrNotConnected is returned when a store is not connected
 | 
						// ErrNotConnected is returned when a store is not connected
 | 
				
			||||||
@@ -21,6 +29,11 @@ var (
 | 
				
			|||||||
	DefaultSeparator = "/"
 | 
						DefaultSeparator = "/"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Event interface {
 | 
				
			||||||
 | 
						Error() error
 | 
				
			||||||
 | 
						Type() EventType
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Store is a data storage interface
 | 
					// Store is a data storage interface
 | 
				
			||||||
type Store interface {
 | 
					type Store interface {
 | 
				
			||||||
	// Name returns store name
 | 
						// Name returns store name
 | 
				
			||||||
@@ -105,3 +118,14 @@ func NewWatchOptions(opts ...WatchOption) (WatchOptions, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	return options, err
 | 
						return options, err
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Watcher interface {
 | 
				
			||||||
 | 
						// Next is a blocking call
 | 
				
			||||||
 | 
						Next() (Event, error)
 | 
				
			||||||
 | 
						// Stop stops the watcher
 | 
				
			||||||
 | 
						Stop()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func Watch(context.Context) (Watcher, error) {
 | 
				
			||||||
 | 
						return nil, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user