uri

package
v10.4.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URIBuilder

type URIBuilder struct {
	// contains filtered or unexported fields
}

URIBuilder is the requested url builder which keeps all the information the server should know to save or retrieve a cached entry's response used on client-side only both from net/http and valyala/fasthttp

func (*URIBuilder) ClientMethod

func (r *URIBuilder) ClientMethod(s string) *URIBuilder

ClientMethod sets the method which the client should call the remote server's handler used to build the final request url too

func (*URIBuilder) ClientURI

func (r *URIBuilder) ClientURI(s string) *URIBuilder

ClientURI sets the client path for the final request url

func (*URIBuilder) ContentType

func (r *URIBuilder) ContentType(s string) *URIBuilder

ContentType sets the cache content type for the final request url

func (*URIBuilder) Lifetime

func (r *URIBuilder) Lifetime(d time.Duration) *URIBuilder

Lifetime sets the cache lifetime for the final request url

func (*URIBuilder) ServerAddr

func (r *URIBuilder) ServerAddr(s string) *URIBuilder

ServerAddr sets the server address for the final request url

func (*URIBuilder) StatusCode

func (r *URIBuilder) StatusCode(code int) *URIBuilder

StatusCode sets the cache status code for the final request url

func (URIBuilder) String

func (r URIBuilder) String() string

String returns the full url which should be passed to get a cache entry response back (it could be setted by server too but we need some client-freedom on the requested key) in order to be sure that the registered cache entries are unique among different clients with the same key note1: we do it manually*, note2: on fasthttp that is not required because the query args added as expected but we will use it there too to be align with net/http

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL