Optinator - Idiomatic way to fill structs with options logic

optinator

Go packages are generally start with a main struct and the package initiates and fills that struct in the beginning. There are so many ways to fill that struct.

In this repo I wanted to show and idiomatic way to fill a struct. This is generally used with "options" parameters. So I called it optinator. Hope you find it helpful.

Example usage:

func main() {
	req := NewReq(
		WithAddress("https://yakuter.com"),
		WithTimeout(30*time.Second),
		WithContentType("application/json"),
	)

	fmt.Printf("%+v", req)
}

Sources:

Owner
Erhan Yakut
Developer
Erhan Yakut
Similar Resources

๐Ÿš€ goprobe is a promising command line tool for inspecting URLs with modern and user-friendly way.

goprobe Build go build -o ./bin/goprobe Example goprobe https://github.com/gaitr/goprobe cat links.txt | goprobe echo "https://github.com/gaitr/

Oct 24, 2021

go-editor is the clean go module that refractors from Kubernetes to help you edit resources in a command-line way.

go-editor The source code of go-editor comes from Kubernetes and refractor as the clean Go module. You can embed go-editor in your command-line tool l

Dec 5, 2021

V2 because I wasn't happy with the way things were going in V1

Pokerchips V2 A client/server app that simulates poker chips so you and your friends can play poke without physical chips! Client The client is writte

Oct 2, 2022

(Probably) The easiest way to clone your base Go project repository

GoStrap GoStrap probably will going to be the easiest way for you to create new Go project using your existing project template. This CLI actually onl

Mar 13, 2022

[UNMANTEINED] Extract values from strings and fill your structs with nlp.

nlp nlp is a general purpose any-lang Natural Language Processor that parses the data inside a text and returns a filled model Supported types int in

Nov 24, 2022

Envopts - Provides a code generator for turning env structs into functional options

envopts Provides a code generator to turn structs annotated for the popular env

Jan 10, 2022

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence Visit cadenceworkflow.io to learn about Cadence. This repo contains the source code of the Cadence server. To implement workflows, activities

Jan 9, 2023

K8s-go-structs - All k8s API Go structs

k8s-api go types Why? Its nice to have it all in a single package. . |-- pkg |

Jul 17, 2022

Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.

โ— Cache package has been moved to libcache repository Go-Guardian Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to

Dec 23, 2022

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

Goth: Multi-Provider Authentication for Go Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applic

Dec 29, 2022

azqlite is a lightweight wrapper around Azure's SDK to interact with the Azure Storage Queue service in a simpler and more idiomatic way.

azqlite azqlite is a lightweight wrapper around github.com/Azure/azure-storage-queue-go to interact with the Azure Storage Queue service in a simpler

Mar 12, 2022

Allows you to fill in variables in your custom project templates.

go-templater The best project templater go-templater lets you use any project template you want and replace the variables with values from the config.

Nov 6, 2021

A simple tool to fill random data into a file to overwrite the free space on a disk

random-fill random-fill is a simple tool to fill random data into a file to over

Oct 2, 2022

Script to fill phishing sites databases with random data and prevent theft

phsfill Script to fill phishing sites databases with random data and prevent theft Installation & Build: To install the library, run go install github

Feb 10, 2022

A wrapper of streadway/amqp that provides reconnection logic and sane defaults

go-rabbitmq Wrapper of streadway/amqp that provides reconnection logic and sane defaults. Hit the project with a star if you find it useful โญ Supporte

Dec 28, 2022

Parses a file and associate SQL queries to a map. Useful for separating SQL from code logic

goyesql This package is based on nleof/goyesql but is not compatible with it any more. This package introduces support for arbitrary tag types and cha

Oct 20, 2021

A go package implementing a simple logic-bomb.

puffgo A simple go package implementing a simple logic-bomb โ— Warning โ— This project is strictly for educational/research purposes, any malicious acti

Dec 21, 2022

Business Logic for Multiply two numbers Service.

Business Logic for Multiply two numbers Service.

Business Logic for Multiply two numbers Service. 1. Related projects This project has two related projects: Rest: https://github.com/kenesparta/tk-res

Oct 19, 2021

Learn-Nakama - An example project template on how to set up and write custom logic in Nakama server

Nakama Project Template An example project template on how to set up and write c

Apr 18, 2022
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.

Sensible and fast command-line flag parsing with excellent support for subcommands and positional values. Flags can be at any position. Flaggy has no

Jan 1, 2023
Tag-based environment configuration for structs

env Tag-based environment configuration for structs. Installation $ go get -u github.com/codingconcepts/env Usage package main import ( "fmt" "log"

Dec 23, 2022
Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...
Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Gonsole - Integrated Console Application library This package rests on a readline console library, (giving advanced completion, hint, input and histor

Nov 20, 2022
An excellent tool for converting json files to structs or classes in any programming language.
An excellent tool for converting json files to structs or classes in any programming language.

Explore Usage ยป Report Bug ยท Request Feature Table of Contents About The Project Supported Languages Getting Started Usage Parameters Set Up Your Own

Dec 10, 2022
A simple way of sending messages from the CLI output to your Discord channel with webhook.
A simple way of sending messages from the CLI output to your Discord channel with webhook.

discat A simple way of sending messages from the CLI output to your Discord channel with webhook. Actually, this is a fork version of slackcat that I

Nov 15, 2022
Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.
Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.

Process Monitor for Linux (Preview) Process Monitor (Procmon) is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools

Dec 29, 2022
A better way to clone, organize and manage multiple git repositories
A better way to clone, organize and manage multiple git repositories

git-get git-get is a better way to clone, organize and manage multiple git repositories. git-get Description Installation macOS Linux Windows Usage gi

Nov 16, 2022
A command tool to help user install oh-my-zsh plugins fast in a comfortable way

zshx A command tool to help user install oh-my-zsh plugins fast in a comfortable way. in other way, it is a zsh plugin package manager. How to use the

Feb 11, 2022
Small CLI Tool to store test artifacts in a tamperproof way

Small CLI Tool to store test artifacts in a tamperproof way

Oct 3, 2022
A simple way for CLI command to have many subcommands

subcommands This is a modified fork of google/subcommands that uses lucasepe/pflag Subcommands is a Go package that implements a simple way for a sing

Oct 12, 2021