Skip to content

Commit

Permalink
Merge pull request #4 from go-coldbrew/ankurs-patch-1
Browse files Browse the repository at this point in the history
Create go.yml
  • Loading branch information
ankurs authored Mar 16, 2023
2 parents 9a1f455 + 9033d9d commit ed4ea8c
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 569 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ test:
go test ./...

doc:
go get github.com/princjef/gomarkdoc/cmd/gomarkdoc
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
gomarkdoc ./...
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import "github.com/go-coldbrew/options"
- [func AddToOptions(ctx context.Context, key string, value interface{}) context.Context](<#func-addtooptions>)
- [type Options](<#type-options>)
- [func FromContext(ctx context.Context) *Options](<#func-fromcontext>)
- [func (o Options) Add(key string, value interface{})](<#func-options-add>)
- [func (o Options) Del(key string)](<#func-options-del>)
- [func (o Options) Get(key string) (interface{}, bool)](<#func-options-get>)
- [func (o *Options) Add(key string, value interface{})](<#func-options-add>)
- [func (o *Options) Del(key string)](<#func-options-del>)
- [func (o *Options) Get(key string) (interface{}, bool)](<#func-options-get>)


## func [AddToOptions](<https://github.com/go-coldbrew/options/blob/main/options.go#L31>)
## func [AddToOptions](<https://github.com/go-coldbrew/options/blob/main/options.go#L30>)

```go
func AddToOptions(ctx context.Context, key string, value interface{}) context.Context
```

AddToOptions adds options to context

## type [Options](<https://github.com/go-coldbrew/options/blob/main/options.go#L16-L18>)
## type [Options](<https://github.com/go-coldbrew/options/blob/main/options.go#L15-L17>)

Options are request options passed from Orion to server

Expand All @@ -36,34 +36,34 @@ type Options struct {
}
```

### func [FromContext](<https://github.com/go-coldbrew/options/blob/main/options.go#L21>)
### func [FromContext](<https://github.com/go-coldbrew/options/blob/main/options.go#L20>)

```go
func FromContext(ctx context.Context) *Options
```

FromContext fetchs options from provided context

### func \(Options\) [Add](<https://github.com/go-coldbrew/options/blob/main/options.go#L44>)
### func \(\*Options\) [Add](<https://github.com/go-coldbrew/options/blob/main/options.go#L43>)

```go
func (o Options) Add(key string, value interface{})
func (o *Options) Add(key string, value interface{})
```

Add to Options

### func \(Options\) [Del](<https://github.com/go-coldbrew/options/blob/main/options.go#L49>)
### func \(\*Options\) [Del](<https://github.com/go-coldbrew/options/blob/main/options.go#L48>)

```go
func (o Options) Del(key string)
func (o *Options) Del(key string)
```

Del an options

### func \(Options\) [Get](<https://github.com/go-coldbrew/options/blob/main/options.go#L54>)
### func \(\*Options\) [Get](<https://github.com/go-coldbrew/options/blob/main/options.go#L53>)

```go
func (o Options) Get(key string) (interface{}, bool)
func (o *Options) Get(key string) (interface{}, bool)
```

Get an options
Expand Down
14 changes: 3 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ module github.com/go-coldbrew/options
go 1.15

require (
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 // indirect
github.com/coreos/go-etcd v2.0.0+incompatible // indirect
github.com/cpuguy83/go-md2man v1.0.10 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mvdan/xurls v1.1.0 // indirect
github.com/princjef/gomarkdoc v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/ugorji/go v1.1.4 // indirect
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 // indirect
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
mvdan.cc/xurls v1.1.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading

0 comments on commit ed4ea8c

Please sign in to comment.