{"modulePath":"github.com/mutablelogic/go-llm","version":"v1.7.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github is GitHub's webhook protocol: its calls are signed, with the secret, in X-Hub-Signature-256, say what happened in X-GitHub-Event, and the body's action, and their delivery in X-GitHub-Delivery. A call whose content type is a form has its JSON in the form's payload field.\n\n[https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries](https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries)\n\n## Constants\n\n```go\nconst (\n\t// Name is the protocol's name\n\tName = \"github\"\n)\n```\n\n## Types\n\n```go\ntype Protocol struct{}\n```\nProtocol is GitHub's protocol\n\n```go\nfunc New() Protocol\n```\nNew returns the protocol\n\n```go\nfunc (Protocol) Check(method string, header http.Header) error\n```\nCheck returns nil when the call is a POST, with its event in X-GitHub-Event, as every call of GitHub's is\n\n```go\nfunc (Protocol) Decode(header http.Header, body []byte) (json.RawMessage, error)\n```\nDecode returns the body, or, when it's a form, its payload field, which is the JSON\n\n```go\nfunc (Protocol) Handshake(*http.Request, string) ([]byte, bool)\n```\n\n```go\nfunc (Protocol) Headers() []string\n```\n\n```go\nfunc (Protocol) Identify(header http.Header, values json.RawMessage) (string, string)\n```\nIdentify returns X-GitHub-Event, and the body's action, when it has one, such as issues.opened, and X-GitHub-Delivery\n\n```go\nfunc (Protocol) Name() string\n```\n\n```go\nfunc (Protocol) Sample(delivery string) (http.Header, []byte)\n```\nSample returns a ping, which GitHub sends when a webhook is set up\n\n```go\nfunc (Protocol) Sign(header http.Header, body []byte, secret string)\n```\nSign sets X-Hub-Signature-256\n\n```go\nfunc (Protocol) Verify(header http.Header, body []byte, secret string) error\n```\nVerify returns nil when X-Hub-Signature-256 is sha256=, and the body's HMAC-SHA256, with the secret, in hex\n\n","path":"github.com/mutablelogic/go-llm/webhook/protocol/github","name":"github","synopsis":"Package github is GitHub's webhook protocol: its calls are signed, with the secret, in X-Hub-Signature-256, say what happened in X-GitHub-Event, and the body's action, and their delivery in X-GitHub-Delivery.","isRedistributable":true}
